diff options
Diffstat (limited to 'include')
157 files changed, 3673 insertions, 5659 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 8760be30b375..cb2a7d1ad47b 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -376,6 +376,7 @@ header-y += tty.h | |||
| 376 | header-y += types.h | 376 | header-y += types.h |
| 377 | header-y += udf_fs_i.h | 377 | header-y += udf_fs_i.h |
| 378 | header-y += udp.h | 378 | header-y += udp.h |
| 379 | header-y += uhid.h | ||
| 379 | header-y += uinput.h | 380 | header-y += uinput.h |
| 380 | header-y += uio.h | 381 | header-y += uio.h |
| 381 | header-y += ultrasound.h | 382 | header-y += ultrasound.h |
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h deleted file mode 100644 index 0260c3e79fdd..000000000000 --- a/include/linux/ac97_codec.h +++ /dev/null | |||
| @@ -1,362 +0,0 @@ | |||
| 1 | #ifndef _AC97_CODEC_H_ | ||
| 2 | #define _AC97_CODEC_H_ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/soundcard.h> | ||
| 6 | |||
| 7 | /* AC97 1.0 */ | ||
| 8 | #define AC97_RESET 0x0000 // | ||
| 9 | #define AC97_MASTER_VOL_STEREO 0x0002 // Line Out | ||
| 10 | #define AC97_HEADPHONE_VOL 0x0004 // | ||
| 11 | #define AC97_MASTER_VOL_MONO 0x0006 // TAD Output | ||
| 12 | #define AC97_MASTER_TONE 0x0008 // | ||
| 13 | #define AC97_PCBEEP_VOL 0x000a // none | ||
| 14 | #define AC97_PHONE_VOL 0x000c // TAD Input (mono) | ||
| 15 | #define AC97_MIC_VOL 0x000e // MIC Input (mono) | ||
| 16 | #define AC97_LINEIN_VOL 0x0010 // Line Input (stereo) | ||
| 17 | #define AC97_CD_VOL 0x0012 // CD Input (stereo) | ||
| 18 | #define AC97_VIDEO_VOL 0x0014 // none | ||
| 19 | #define AC97_AUX_VOL 0x0016 // Aux Input (stereo) | ||
| 20 | #define AC97_PCMOUT_VOL 0x0018 // Wave Output (stereo) | ||
| 21 | #define AC97_RECORD_SELECT 0x001a // | ||
| 22 | #define AC97_RECORD_GAIN 0x001c | ||
| 23 | #define AC97_RECORD_GAIN_MIC 0x001e | ||
| 24 | #define AC97_GENERAL_PURPOSE 0x0020 | ||
| 25 | #define AC97_3D_CONTROL 0x0022 | ||
| 26 | #define AC97_MODEM_RATE 0x0024 | ||
| 27 | #define AC97_POWER_CONTROL 0x0026 | ||
| 28 | |||
| 29 | /* AC'97 2.0 */ | ||
| 30 | #define AC97_EXTENDED_ID 0x0028 /* Extended Audio ID */ | ||
| 31 | #define AC97_EXTENDED_STATUS 0x002A /* Extended Audio Status */ | ||
| 32 | #define AC97_PCM_FRONT_DAC_RATE 0x002C /* PCM Front DAC Rate */ | ||
| 33 | #define AC97_PCM_SURR_DAC_RATE 0x002E /* PCM Surround DAC Rate */ | ||
| 34 | #define AC97_PCM_LFE_DAC_RATE 0x0030 /* PCM LFE DAC Rate */ | ||
| 35 | #define AC97_PCM_LR_ADC_RATE 0x0032 /* PCM LR ADC Rate */ | ||
| 36 | #define AC97_PCM_MIC_ADC_RATE 0x0034 /* PCM MIC ADC Rate */ | ||
| 37 | #define AC97_CENTER_LFE_MASTER 0x0036 /* Center + LFE Master Volume */ | ||
| 38 | #define AC97_SURROUND_MASTER 0x0038 /* Surround (Rear) Master Volume */ | ||
| 39 | #define AC97_RESERVED_3A 0x003A /* Reserved in AC '97 < 2.2 */ | ||
| 40 | |||
| 41 | /* AC'97 2.2 */ | ||
| 42 | #define AC97_SPDIF_CONTROL 0x003A /* S/PDIF Control */ | ||
| 43 | |||
| 44 | /* range 0x3c-0x58 - MODEM */ | ||
| 45 | #define AC97_EXTENDED_MODEM_ID 0x003C | ||
| 46 | #define AC97_EXTEND_MODEM_STAT 0x003E | ||
| 47 | #define AC97_LINE1_RATE 0x0040 | ||
| 48 | #define AC97_LINE2_RATE 0x0042 | ||
| 49 | #define AC97_HANDSET_RATE 0x0044 | ||
| 50 | #define AC97_LINE1_LEVEL 0x0046 | ||
| 51 | #define AC97_LINE2_LEVEL 0x0048 | ||
| 52 | #define AC97_HANDSET_LEVEL 0x004A | ||
| 53 | #define AC97_GPIO_CONFIG 0x004C | ||
| 54 | #define AC97_GPIO_POLARITY 0x004E | ||
| 55 | #define AC97_GPIO_STICKY 0x0050 | ||
| 56 | #define AC97_GPIO_WAKE_UP 0x0052 | ||
| 57 | #define AC97_GPIO_STATUS 0x0054 | ||
| 58 | #define AC97_MISC_MODEM_STAT 0x0056 | ||
| 59 | #define AC97_RESERVED_58 0x0058 | ||
| 60 | |||
| 61 | /* registers 0x005a - 0x007a are vendor reserved */ | ||
| 62 | |||
| 63 | #define AC97_VENDOR_ID1 0x007c | ||
| 64 | #define AC97_VENDOR_ID2 0x007e | ||
| 65 | |||
| 66 | /* volume control bit defines */ | ||
| 67 | #define AC97_MUTE 0x8000 | ||
| 68 | #define AC97_MICBOOST 0x0040 | ||
| 69 | #define AC97_LEFTVOL 0x3f00 | ||
| 70 | #define AC97_RIGHTVOL 0x003f | ||
| 71 | |||
| 72 | /* record mux defines */ | ||
| 73 | #define AC97_RECMUX_MIC 0x0000 | ||
| 74 | #define AC97_RECMUX_CD 0x0101 | ||
| 75 | #define AC97_RECMUX_VIDEO 0x0202 | ||
| 76 | #define AC97_RECMUX_AUX 0x0303 | ||
| 77 | #define AC97_RECMUX_LINE 0x0404 | ||
| 78 | #define AC97_RECMUX_STEREO_MIX 0x0505 | ||
| 79 | #define AC97_RECMUX_MONO_MIX 0x0606 | ||
| 80 | #define AC97_RECMUX_PHONE 0x0707 | ||
| 81 | |||
| 82 | /* general purpose register bit defines */ | ||
| 83 | #define AC97_GP_LPBK 0x0080 /* Loopback mode */ | ||
| 84 | #define AC97_GP_MS 0x0100 /* Mic Select 0=Mic1, 1=Mic2 */ | ||
| 85 | #define AC97_GP_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic */ | ||
| 86 | #define AC97_GP_RLBK 0x0400 /* Remote Loopback - Modem line codec */ | ||
| 87 | #define AC97_GP_LLBK 0x0800 /* Local Loopback - Modem Line codec */ | ||
| 88 | #define AC97_GP_LD 0x1000 /* Loudness 1=on */ | ||
| 89 | #define AC97_GP_3D 0x2000 /* 3D Enhancement 1=on */ | ||
| 90 | #define AC97_GP_ST 0x4000 /* Stereo Enhancement 1=on */ | ||
| 91 | #define AC97_GP_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */ | ||
| 92 | |||
| 93 | /* extended audio status and control bit defines */ | ||
| 94 | #define AC97_EA_VRA 0x0001 /* Variable bit rate enable bit */ | ||
| 95 | #define AC97_EA_DRA 0x0002 /* Double-rate audio enable bit */ | ||
| 96 | #define AC97_EA_SPDIF 0x0004 /* S/PDIF Enable bit */ | ||
| 97 | #define AC97_EA_VRM 0x0008 /* Variable bit rate for MIC enable bit */ | ||
| 98 | #define AC97_EA_CDAC 0x0040 /* PCM Center DAC is ready (Read only) */ | ||
| 99 | #define AC97_EA_SDAC 0x0040 /* PCM Surround DACs are ready (Read only) */ | ||
| 100 | #define AC97_EA_LDAC 0x0080 /* PCM LFE DAC is ready (Read only) */ | ||
| 101 | #define AC97_EA_MDAC 0x0100 /* MIC ADC is ready (Read only) */ | ||
| 102 | #define AC97_EA_SPCV 0x0400 /* S/PDIF configuration valid (Read only) */ | ||
| 103 | #define AC97_EA_PRI 0x0800 /* Turns the PCM Center DAC off */ | ||
| 104 | #define AC97_EA_PRJ 0x1000 /* Turns the PCM Surround DACs off */ | ||
| 105 | #define AC97_EA_PRK 0x2000 /* Turns the PCM LFE DAC off */ | ||
| 106 | #define AC97_EA_PRL 0x4000 /* Turns the MIC ADC off */ | ||
| 107 | #define AC97_EA_SLOT_MASK 0xffcf /* Mask for slot assignment bits */ | ||
| 108 | #define AC97_EA_SPSA_3_4 0x0000 /* Slot assigned to 3 & 4 */ | ||
| 109 | #define AC97_EA_SPSA_7_8 0x0010 /* Slot assigned to 7 & 8 */ | ||
| 110 | #define AC97_EA_SPSA_6_9 0x0020 /* Slot assigned to 6 & 9 */ | ||
| 111 | #define AC97_EA_SPSA_10_11 0x0030 /* Slot assigned to 10 & 11 */ | ||
| 112 | |||
| 113 | /* S/PDIF control bit defines */ | ||
| 114 | #define AC97_SC_PRO 0x0001 /* Professional status */ | ||
| 115 | #define AC97_SC_NAUDIO 0x0002 /* Non audio stream */ | ||
| 116 | #define AC97_SC_COPY 0x0004 /* Copyright status */ | ||
| 117 | #define AC97_SC_PRE 0x0008 /* Preemphasis status */ | ||
| 118 | #define AC97_SC_CC_MASK 0x07f0 /* Category Code mask */ | ||
| 119 | #define AC97_SC_L 0x0800 /* Generation Level status */ | ||
| 120 | #define AC97_SC_SPSR_MASK 0xcfff /* S/PDIF Sample Rate bits */ | ||
| 121 | #define AC97_SC_SPSR_44K 0x0000 /* Use 44.1kHz Sample rate */ | ||
| 122 | #define AC97_SC_SPSR_48K 0x2000 /* Use 48kHz Sample rate */ | ||
| 123 | #define AC97_SC_SPSR_32K 0x3000 /* Use 32kHz Sample rate */ | ||
| 124 | #define AC97_SC_DRS 0x4000 /* Double Rate S/PDIF */ | ||
| 125 | #define AC97_SC_V 0x8000 /* Validity status */ | ||
| 126 | |||
| 127 | /* powerdown control and status bit defines */ | ||
| 128 | |||
| 129 | /* status */ | ||
| 130 | #define AC97_PWR_MDM 0x0010 /* Modem section ready */ | ||
| 131 | #define AC97_PWR_REF 0x0008 /* Vref nominal */ | ||
| 132 | #define AC97_PWR_ANL 0x0004 /* Analog section ready */ | ||
| 133 | #define AC97_PWR_DAC 0x0002 /* DAC section ready */ | ||
| 134 | #define AC97_PWR_ADC 0x0001 /* ADC section ready */ | ||
| 135 | |||
| 136 | /* control */ | ||
| 137 | #define AC97_PWR_PR0 0x0100 /* ADC and Mux powerdown */ | ||
| 138 | #define AC97_PWR_PR1 0x0200 /* DAC powerdown */ | ||
| 139 | #define AC97_PWR_PR2 0x0400 /* Output mixer powerdown (Vref on) */ | ||
| 140 | #define AC97_PWR_PR3 0x0800 /* Output mixer powerdown (Vref off) */ | ||
| 141 | #define AC97_PWR_PR4 0x1000 /* AC-link powerdown */ | ||
| 142 | #define AC97_PWR_PR5 0x2000 /* Internal Clk disable */ | ||
| 143 | #define AC97_PWR_PR6 0x4000 /* HP amp powerdown */ | ||
| 144 | #define AC97_PWR_PR7 0x8000 /* Modem off - if supported */ | ||
| 145 | |||
| 146 | /* extended audio ID register bit defines */ | ||
| 147 | #define AC97_EXTID_VRA 0x0001 | ||
| 148 | #define AC97_EXTID_DRA 0x0002 | ||
| 149 | #define AC97_EXTID_SPDIF 0x0004 | ||
| 150 | #define AC97_EXTID_VRM 0x0008 | ||
| 151 | #define AC97_EXTID_DSA0 0x0010 | ||
| 152 | #define AC97_EXTID_DSA1 0x0020 | ||
| 153 | #define AC97_EXTID_CDAC 0x0040 | ||
| 154 | #define AC97_EXTID_SDAC 0x0080 | ||
| 155 | #define AC97_EXTID_LDAC 0x0100 | ||
| 156 | #define AC97_EXTID_AMAP 0x0200 | ||
| 157 | #define AC97_EXTID_REV0 0x0400 | ||
| 158 | #define AC97_EXTID_REV1 0x0800 | ||
| 159 | #define AC97_EXTID_ID0 0x4000 | ||
| 160 | #define AC97_EXTID_ID1 0x8000 | ||
| 161 | |||
| 162 | /* extended status register bit defines */ | ||
| 163 | #define AC97_EXTSTAT_VRA 0x0001 | ||
| 164 | #define AC97_EXTSTAT_DRA 0x0002 | ||
| 165 | #define AC97_EXTSTAT_SPDIF 0x0004 | ||
| 166 | #define AC97_EXTSTAT_VRM 0x0008 | ||
| 167 | #define AC97_EXTSTAT_SPSA0 0x0010 | ||
| 168 | #define AC97_EXTSTAT_SPSA1 0x0020 | ||
| 169 | #define AC97_EXTSTAT_CDAC 0x0040 | ||
| 170 | #define AC97_EXTSTAT_SDAC 0x0080 | ||
| 171 | #define AC97_EXTSTAT_LDAC 0x0100 | ||
| 172 | #define AC97_EXTSTAT_MADC 0x0200 | ||
| 173 | #define AC97_EXTSTAT_SPCV 0x0400 | ||
| 174 | #define AC97_EXTSTAT_PRI 0x0800 | ||
| 175 | #define AC97_EXTSTAT_PRJ 0x1000 | ||
| 176 | #define AC97_EXTSTAT_PRK 0x2000 | ||
| 177 | #define AC97_EXTSTAT_PRL 0x4000 | ||
| 178 | |||
| 179 | /* extended audio ID register bit defines */ | ||
| 180 | #define AC97_EXTID_VRA 0x0001 | ||
| 181 | #define AC97_EXTID_DRA 0x0002 | ||
| 182 | #define AC97_EXTID_SPDIF 0x0004 | ||
| 183 | #define AC97_EXTID_VRM 0x0008 | ||
| 184 | #define AC97_EXTID_DSA0 0x0010 | ||
| 185 | #define AC97_EXTID_DSA1 0x0020 | ||
| 186 | #define AC97_EXTID_CDAC 0x0040 | ||
| 187 | #define AC97_EXTID_SDAC 0x0080 | ||
| 188 | #define AC97_EXTID_LDAC 0x0100 | ||
| 189 | #define AC97_EXTID_AMAP 0x0200 | ||
| 190 | #define AC97_EXTID_REV0 0x0400 | ||
| 191 | #define AC97_EXTID_REV1 0x0800 | ||
| 192 | #define AC97_EXTID_ID0 0x4000 | ||
| 193 | #define AC97_EXTID_ID1 0x8000 | ||
| 194 | |||
| 195 | /* extended status register bit defines */ | ||
| 196 | #define AC97_EXTSTAT_VRA 0x0001 | ||
| 197 | #define AC97_EXTSTAT_DRA 0x0002 | ||
| 198 | #define AC97_EXTSTAT_SPDIF 0x0004 | ||
| 199 | #define AC97_EXTSTAT_VRM 0x0008 | ||
| 200 | #define AC97_EXTSTAT_SPSA0 0x0010 | ||
| 201 | #define AC97_EXTSTAT_SPSA1 0x0020 | ||
| 202 | #define AC97_EXTSTAT_CDAC 0x0040 | ||
| 203 | #define AC97_EXTSTAT_SDAC 0x0080 | ||
| 204 | #define AC97_EXTSTAT_LDAC 0x0100 | ||
| 205 | #define AC97_EXTSTAT_MADC 0x0200 | ||
| 206 | #define AC97_EXTSTAT_SPCV 0x0400 | ||
| 207 | #define AC97_EXTSTAT_PRI 0x0800 | ||
| 208 | #define AC97_EXTSTAT_PRJ 0x1000 | ||
| 209 | #define AC97_EXTSTAT_PRK 0x2000 | ||
| 210 | #define AC97_EXTSTAT_PRL 0x4000 | ||
| 211 | |||
| 212 | /* useful power states */ | ||
| 213 | #define AC97_PWR_D0 0x0000 /* everything on */ | ||
| 214 | #define AC97_PWR_D1 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR4 | ||
| 215 | #define AC97_PWR_D2 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 | ||
| 216 | #define AC97_PWR_D3 AC97_PWR_PR0|AC97_PWR_PR1|AC97_PWR_PR2|AC97_PWR_PR3|AC97_PWR_PR4 | ||
| 217 | #define AC97_PWR_ANLOFF AC97_PWR_PR2|AC97_PWR_PR3 /* analog section off */ | ||
| 218 | |||
| 219 | /* Total number of defined registers. */ | ||
| 220 | #define AC97_REG_CNT 64 | ||
| 221 | |||
| 222 | |||
| 223 | /* OSS interface to the ac97s.. */ | ||
| 224 | #define AC97_STEREO_MASK (SOUND_MASK_VOLUME|SOUND_MASK_PCM|\ | ||
| 225 | SOUND_MASK_LINE|SOUND_MASK_CD|\ | ||
| 226 | SOUND_MASK_ALTPCM|SOUND_MASK_IGAIN|\ | ||
| 227 | SOUND_MASK_LINE1|SOUND_MASK_VIDEO) | ||
| 228 | |||
| 229 | #define AC97_SUPPORTED_MASK (AC97_STEREO_MASK | \ | ||
| 230 | SOUND_MASK_BASS|SOUND_MASK_TREBLE|\ | ||
| 231 | SOUND_MASK_SPEAKER|SOUND_MASK_MIC|\ | ||
| 232 | SOUND_MASK_PHONEIN|SOUND_MASK_PHONEOUT) | ||
| 233 | |||
| 234 | #define AC97_RECORD_MASK (SOUND_MASK_MIC|\ | ||
| 235 | SOUND_MASK_CD|SOUND_MASK_IGAIN|SOUND_MASK_VIDEO|\ | ||
| 236 | SOUND_MASK_LINE1| SOUND_MASK_LINE|\ | ||
| 237 | SOUND_MASK_PHONEIN) | ||
| 238 | |||
| 239 | /* original check is not good enough in case FOO is greater than | ||
| 240 | * SOUND_MIXER_NRDEVICES because the supported_mixers has exactly | ||
| 241 | * SOUND_MIXER_NRDEVICES elements. | ||
| 242 | * before matching the given mixer against the bitmask in supported_mixers we | ||
| 243 | * check if mixer number exceeds maximum allowed size which is as mentioned | ||
| 244 | * above SOUND_MIXER_NRDEVICES */ | ||
| 245 | #define supported_mixer(CODEC,FOO) ((FOO >= 0) && \ | ||
| 246 | (FOO < SOUND_MIXER_NRDEVICES) && \ | ||
| 247 | (CODEC)->supported_mixers & (1<<FOO) ) | ||
| 248 | |||
| 249 | struct ac97_codec { | ||
| 250 | /* Linked list of codecs */ | ||
| 251 | struct list_head list; | ||
| 252 | |||
| 253 | /* AC97 controller connected with */ | ||
| 254 | void *private_data; | ||
| 255 | |||
| 256 | char *name; | ||
| 257 | int id; | ||
| 258 | int dev_mixer; | ||
| 259 | int type; | ||
| 260 | u32 model; | ||
| 261 | |||
| 262 | unsigned int modem:1; | ||
| 263 | |||
| 264 | struct ac97_ops *codec_ops; | ||
| 265 | |||
| 266 | /* controller specific lower leverl ac97 accessing routines. | ||
| 267 | must be re-entrant safe */ | ||
| 268 | u16 (*codec_read) (struct ac97_codec *codec, u8 reg); | ||
| 269 | void (*codec_write) (struct ac97_codec *codec, u8 reg, u16 val); | ||
| 270 | |||
| 271 | /* Wait for codec-ready. Ok to sleep here. */ | ||
| 272 | void (*codec_wait) (struct ac97_codec *codec); | ||
| 273 | |||
| 274 | /* callback used by helper drivers for interesting ac97 setups */ | ||
| 275 | void (*codec_unregister) (struct ac97_codec *codec); | ||
| 276 | |||
| 277 | struct ac97_driver *driver; | ||
| 278 | void *driver_private; /* Private data for the driver */ | ||
| 279 | |||
| 280 | spinlock_t lock; | ||
| 281 | |||
| 282 | /* OSS mixer masks */ | ||
| 283 | int modcnt; | ||
| 284 | int supported_mixers; | ||
| 285 | int stereo_mixers; | ||
| 286 | int record_sources; | ||
| 287 | |||
| 288 | /* Property flags */ | ||
| 289 | int flags; | ||
| 290 | |||
| 291 | int bit_resolution; | ||
| 292 | |||
| 293 | /* OSS mixer interface */ | ||
| 294 | int (*read_mixer) (struct ac97_codec *codec, int oss_channel); | ||
| 295 | void (*write_mixer)(struct ac97_codec *codec, int oss_channel, | ||
| 296 | unsigned int left, unsigned int right); | ||
| 297 | int (*recmask_io) (struct ac97_codec *codec, int rw, int mask); | ||
| 298 | int (*mixer_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg); | ||
| 299 | |||
| 300 | /* saved OSS mixer states */ | ||
| 301 | unsigned int mixer_state[SOUND_MIXER_NRDEVICES]; | ||
| 302 | |||
| 303 | /* Software Modem interface */ | ||
| 304 | int (*modem_ioctl)(struct ac97_codec *codec, unsigned int cmd, unsigned long arg); | ||
| 305 | }; | ||
| 306 | |||
| 307 | /* | ||
| 308 | * Operation structures for each known AC97 chip | ||
| 309 | */ | ||
| 310 | |||
| 311 | struct ac97_ops | ||
| 312 | { | ||
| 313 | /* Initialise */ | ||
| 314 | int (*init)(struct ac97_codec *c); | ||
| 315 | /* Amplifier control */ | ||
| 316 | int (*amplifier)(struct ac97_codec *codec, int on); | ||
| 317 | /* Digital mode control */ | ||
| 318 | int (*digital)(struct ac97_codec *codec, int slots, int rate, int mode); | ||
| 319 | #define AUDIO_DIGITAL 0x8000 | ||
| 320 | #define AUDIO_PRO 0x4000 | ||
| 321 | #define AUDIO_DRS 0x2000 | ||
| 322 | #define AUDIO_CCMASK 0x003F | ||
| 323 | |||
| 324 | #define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */ | ||
| 325 | #define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */ | ||
| 326 | #define AC97_DEFAULT_POWER_OFF 4 /* Needs warm reset to power up */ | ||
| 327 | }; | ||
| 328 | |||
| 329 | extern int ac97_probe_codec(struct ac97_codec *); | ||
| 330 | |||
| 331 | extern struct ac97_codec *ac97_alloc_codec(void); | ||
| 332 | extern void ac97_release_codec(struct ac97_codec *codec); | ||
| 333 | |||
| 334 | struct ac97_driver { | ||
| 335 | struct list_head list; | ||
| 336 | char *name; | ||
| 337 | u32 codec_id; | ||
| 338 | u32 codec_mask; | ||
| 339 | int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver); | ||
| 340 | void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver); | ||
| 341 | }; | ||
| 342 | |||
| 343 | /* quirk types */ | ||
| 344 | enum { | ||
| 345 | AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */ | ||
| 346 | AC97_TUNE_NONE = 0, /* nothing extra to do */ | ||
| 347 | AC97_TUNE_HP_ONLY, /* headphone (true line-out) control as master only */ | ||
| 348 | AC97_TUNE_SWAP_HP, /* swap headphone and master controls */ | ||
| 349 | AC97_TUNE_SWAP_SURROUND, /* swap master and surround controls */ | ||
| 350 | AC97_TUNE_AD_SHARING, /* for AD1985, turn on OMS bit and use headphone */ | ||
| 351 | AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */ | ||
| 352 | }; | ||
| 353 | |||
| 354 | struct ac97_quirk { | ||
| 355 | unsigned short vendor; /* PCI vendor id */ | ||
| 356 | unsigned short device; /* PCI device id */ | ||
| 357 | unsigned short mask; /* device id bit mask, 0 = accept all */ | ||
| 358 | const char *name; /* name shown as info */ | ||
| 359 | int type; /* quirk type above */ | ||
| 360 | }; | ||
| 361 | |||
| 362 | #endif /* _AC97_CODEC_H_ */ | ||
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 8deaf6d050c3..1954a4e305a3 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/bcma/bcma_driver_chipcommon.h> | 7 | #include <linux/bcma/bcma_driver_chipcommon.h> |
| 8 | #include <linux/bcma/bcma_driver_pci.h> | 8 | #include <linux/bcma/bcma_driver_pci.h> |
| 9 | #include <linux/bcma/bcma_driver_mips.h> | 9 | #include <linux/bcma/bcma_driver_mips.h> |
| 10 | #include <linux/bcma/bcma_driver_gmac_cmn.h> | ||
| 10 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | 11 | #include <linux/ssb/ssb.h> /* SPROM sharing */ |
| 11 | 12 | ||
| 12 | #include "bcma_regs.h" | 13 | #include "bcma_regs.h" |
| @@ -70,6 +71,13 @@ struct bcma_host_ops { | |||
| 70 | 71 | ||
| 71 | /* Core-ID values. */ | 72 | /* Core-ID values. */ |
| 72 | #define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ | 73 | #define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ |
| 74 | #define BCMA_CORE_4706_CHIPCOMMON 0x500 | ||
| 75 | #define BCMA_CORE_4706_SOC_RAM 0x50E | ||
| 76 | #define BCMA_CORE_4706_MAC_GBIT 0x52D | ||
| 77 | #define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */ | ||
| 78 | #define BCMA_CORE_ALTA 0x534 /* I2S core */ | ||
| 79 | #define BCMA_CORE_4706_MAC_GBIT_COMMON 0x5DC | ||
| 80 | #define BCMA_CORE_DDR23_PHY 0x5DD | ||
| 73 | #define BCMA_CORE_INVALID 0x700 | 81 | #define BCMA_CORE_INVALID 0x700 |
| 74 | #define BCMA_CORE_CHIPCOMMON 0x800 | 82 | #define BCMA_CORE_CHIPCOMMON 0x800 |
| 75 | #define BCMA_CORE_ILINE20 0x801 | 83 | #define BCMA_CORE_ILINE20 0x801 |
| @@ -130,6 +138,36 @@ struct bcma_host_ops { | |||
| 130 | 138 | ||
| 131 | #define BCMA_MAX_NR_CORES 16 | 139 | #define BCMA_MAX_NR_CORES 16 |
| 132 | 140 | ||
| 141 | /* Chip IDs of PCIe devices */ | ||
| 142 | #define BCMA_CHIP_ID_BCM4313 0x4313 | ||
| 143 | #define BCMA_CHIP_ID_BCM43224 43224 | ||
| 144 | #define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 | ||
| 145 | #define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa | ||
| 146 | #define BCMA_CHIP_ID_BCM43225 43225 | ||
| 147 | #define BCMA_CHIP_ID_BCM43227 43227 | ||
| 148 | #define BCMA_CHIP_ID_BCM43228 43228 | ||
| 149 | #define BCMA_CHIP_ID_BCM43421 43421 | ||
| 150 | #define BCMA_CHIP_ID_BCM43428 43428 | ||
| 151 | #define BCMA_CHIP_ID_BCM43431 43431 | ||
| 152 | #define BCMA_CHIP_ID_BCM43460 43460 | ||
| 153 | #define BCMA_CHIP_ID_BCM4331 0x4331 | ||
| 154 | #define BCMA_CHIP_ID_BCM6362 0x6362 | ||
| 155 | #define BCMA_CHIP_ID_BCM4360 0x4360 | ||
| 156 | #define BCMA_CHIP_ID_BCM4352 0x4352 | ||
| 157 | |||
| 158 | /* Chip IDs of SoCs */ | ||
| 159 | #define BCMA_CHIP_ID_BCM4706 0x5300 | ||
| 160 | #define BCMA_CHIP_ID_BCM4716 0x4716 | ||
| 161 | #define BCMA_PKG_ID_BCM4716 8 | ||
| 162 | #define BCMA_PKG_ID_BCM4717 9 | ||
| 163 | #define BCMA_PKG_ID_BCM4718 10 | ||
| 164 | #define BCMA_CHIP_ID_BCM47162 47162 | ||
| 165 | #define BCMA_CHIP_ID_BCM4748 0x4748 | ||
| 166 | #define BCMA_CHIP_ID_BCM4749 0x4749 | ||
| 167 | #define BCMA_CHIP_ID_BCM5356 0x5356 | ||
| 168 | #define BCMA_CHIP_ID_BCM5357 0x5357 | ||
| 169 | #define BCMA_CHIP_ID_BCM53572 53572 | ||
| 170 | |||
| 133 | struct bcma_device { | 171 | struct bcma_device { |
| 134 | struct bcma_bus *bus; | 172 | struct bcma_bus *bus; |
| 135 | struct bcma_device_id id; | 173 | struct bcma_device_id id; |
| @@ -215,6 +253,7 @@ struct bcma_bus { | |||
| 215 | struct bcma_drv_cc drv_cc; | 253 | struct bcma_drv_cc drv_cc; |
| 216 | struct bcma_drv_pci drv_pci; | 254 | struct bcma_drv_pci drv_pci; |
| 217 | struct bcma_drv_mips drv_mips; | 255 | struct bcma_drv_mips drv_mips; |
| 256 | struct bcma_drv_gmac_cmn drv_gmac_cmn; | ||
| 218 | 257 | ||
| 219 | /* We decided to share SPROM struct with SSB as long as we do not need | 258 | /* We decided to share SPROM struct with SSB as long as we do not need |
| 220 | * any hacks for BCMA. This simplifies drivers code. */ | 259 | * any hacks for BCMA. This simplifies drivers code. */ |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 8bbfe31fbac8..3c80885fa829 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ | 24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ |
| 25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ | 25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ |
| 26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ | 26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ |
| 27 | #define BCMA_CC_FLASHT_NFLASH 0x00000200 | 27 | #define BCMA_CC_FLASHT_NFLASH 0x00000200 /* NAND flash */ |
| 28 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ | 28 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ |
| 29 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ | 29 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ |
| 30 | #define BCMA_PLLTYPE_NONE 0x00000000 | 30 | #define BCMA_PLLTYPE_NONE 0x00000000 |
| @@ -45,6 +45,7 @@ | |||
| 45 | #define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ | 45 | #define BCMA_CC_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ |
| 46 | #define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ | 46 | #define BCMA_CC_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ |
| 47 | #define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ | 47 | #define BCMA_CC_CAP_SPROM 0x40000000 /* SPROM present */ |
| 48 | #define BCMA_CC_CAP_NFLASH 0x80000000 /* NAND flash present (rev >= 35 or BCM4706?) */ | ||
| 48 | #define BCMA_CC_CORECTL 0x0008 | 49 | #define BCMA_CC_CORECTL 0x0008 |
| 49 | #define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ | 50 | #define BCMA_CC_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ |
| 50 | #define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ | 51 | #define BCMA_CC_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ |
| @@ -88,6 +89,11 @@ | |||
| 88 | #define BCMA_CC_CHIPST_4313_OTP_PRESENT 2 | 89 | #define BCMA_CC_CHIPST_4313_OTP_PRESENT 2 |
| 89 | #define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2 | 90 | #define BCMA_CC_CHIPST_4331_SPROM_PRESENT 2 |
| 90 | #define BCMA_CC_CHIPST_4331_OTP_PRESENT 4 | 91 | #define BCMA_CC_CHIPST_4331_OTP_PRESENT 4 |
| 92 | #define BCMA_CC_CHIPST_4706_PKG_OPTION BIT(0) /* 0: full-featured package 1: low-cost package */ | ||
| 93 | #define BCMA_CC_CHIPST_4706_SFLASH_PRESENT BIT(1) /* 0: parallel, 1: serial flash is present */ | ||
| 94 | #define BCMA_CC_CHIPST_4706_SFLASH_TYPE BIT(2) /* 0: 8b-p/ST-s flash, 1: 16b-p/Atmal-s flash */ | ||
| 95 | #define BCMA_CC_CHIPST_4706_MIPS_BENDIAN BIT(3) /* 0: little, 1: big endian */ | ||
| 96 | #define BCMA_CC_CHIPST_4706_PCIE1_DISABLE BIT(5) /* PCIE1 enable strap pin */ | ||
| 91 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ | 97 | #define BCMA_CC_JCMD 0x0030 /* Rev >= 10 only */ |
| 92 | #define BCMA_CC_JCMD_START 0x80000000 | 98 | #define BCMA_CC_JCMD_START 0x80000000 |
| 93 | #define BCMA_CC_JCMD_BUSY 0x80000000 | 99 | #define BCMA_CC_JCMD_BUSY 0x80000000 |
| @@ -117,10 +123,58 @@ | |||
| 117 | #define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ | 123 | #define BCMA_CC_JCTL_EXT_EN 2 /* Enable external targets */ |
| 118 | #define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ | 124 | #define BCMA_CC_JCTL_EN 1 /* Enable Jtag master */ |
| 119 | #define BCMA_CC_FLASHCTL 0x0040 | 125 | #define BCMA_CC_FLASHCTL 0x0040 |
| 126 | /* Start/busy bit in flashcontrol */ | ||
| 127 | #define BCMA_CC_FLASHCTL_OPCODE 0x000000ff | ||
| 128 | #define BCMA_CC_FLASHCTL_ACTION 0x00000700 | ||
| 129 | #define BCMA_CC_FLASHCTL_CS_ACTIVE 0x00001000 /* Chip Select Active, rev >= 20 */ | ||
| 120 | #define BCMA_CC_FLASHCTL_START 0x80000000 | 130 | #define BCMA_CC_FLASHCTL_START 0x80000000 |
| 121 | #define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START | 131 | #define BCMA_CC_FLASHCTL_BUSY BCMA_CC_FLASHCTL_START |
| 132 | /* Flashcontrol action + opcodes for ST flashes */ | ||
| 133 | #define BCMA_CC_FLASHCTL_ST_WREN 0x0006 /* Write Enable */ | ||
| 134 | #define BCMA_CC_FLASHCTL_ST_WRDIS 0x0004 /* Write Disable */ | ||
| 135 | #define BCMA_CC_FLASHCTL_ST_RDSR 0x0105 /* Read Status Register */ | ||
| 136 | #define BCMA_CC_FLASHCTL_ST_WRSR 0x0101 /* Write Status Register */ | ||
| 137 | #define BCMA_CC_FLASHCTL_ST_READ 0x0303 /* Read Data Bytes */ | ||
| 138 | #define BCMA_CC_FLASHCTL_ST_PP 0x0302 /* Page Program */ | ||
| 139 | #define BCMA_CC_FLASHCTL_ST_SE 0x02d8 /* Sector Erase */ | ||
| 140 | #define BCMA_CC_FLASHCTL_ST_BE 0x00c7 /* Bulk Erase */ | ||
| 141 | #define BCMA_CC_FLASHCTL_ST_DP 0x00b9 /* Deep Power-down */ | ||
| 142 | #define BCMA_CC_FLASHCTL_ST_RES 0x03ab /* Read Electronic Signature */ | ||
| 143 | #define BCMA_CC_FLASHCTL_ST_CSA 0x1000 /* Keep chip select asserted */ | ||
| 144 | #define BCMA_CC_FLASHCTL_ST_SSE 0x0220 /* Sub-sector Erase */ | ||
| 145 | /* Flashcontrol action + opcodes for Atmel flashes */ | ||
| 146 | #define BCMA_CC_FLASHCTL_AT_READ 0x07e8 | ||
| 147 | #define BCMA_CC_FLASHCTL_AT_PAGE_READ 0x07d2 | ||
| 148 | #define BCMA_CC_FLASHCTL_AT_STATUS 0x01d7 | ||
| 149 | #define BCMA_CC_FLASHCTL_AT_BUF1_WRITE 0x0384 | ||
| 150 | #define BCMA_CC_FLASHCTL_AT_BUF2_WRITE 0x0387 | ||
| 151 | #define BCMA_CC_FLASHCTL_AT_BUF1_ERASE_PROGRAM 0x0283 | ||
| 152 | #define BCMA_CC_FLASHCTL_AT_BUF2_ERASE_PROGRAM 0x0286 | ||
| 153 | #define BCMA_CC_FLASHCTL_AT_BUF1_PROGRAM 0x0288 | ||
| 154 | #define BCMA_CC_FLASHCTL_AT_BUF2_PROGRAM 0x0289 | ||
| 155 | #define BCMA_CC_FLASHCTL_AT_PAGE_ERASE 0x0281 | ||
| 156 | #define BCMA_CC_FLASHCTL_AT_BLOCK_ERASE 0x0250 | ||
| 157 | #define BCMA_CC_FLASHCTL_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382 | ||
| 158 | #define BCMA_CC_FLASHCTL_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385 | ||
| 159 | #define BCMA_CC_FLASHCTL_AT_BUF1_LOAD 0x0253 | ||
| 160 | #define BCMA_CC_FLASHCTL_AT_BUF2_LOAD 0x0255 | ||
| 161 | #define BCMA_CC_FLASHCTL_AT_BUF1_COMPARE 0x0260 | ||
| 162 | #define BCMA_CC_FLASHCTL_AT_BUF2_COMPARE 0x0261 | ||
| 163 | #define BCMA_CC_FLASHCTL_AT_BUF1_REPROGRAM 0x0258 | ||
| 164 | #define BCMA_CC_FLASHCTL_AT_BUF2_REPROGRAM 0x0259 | ||
| 122 | #define BCMA_CC_FLASHADDR 0x0044 | 165 | #define BCMA_CC_FLASHADDR 0x0044 |
| 123 | #define BCMA_CC_FLASHDATA 0x0048 | 166 | #define BCMA_CC_FLASHDATA 0x0048 |
| 167 | /* Status register bits for ST flashes */ | ||
| 168 | #define BCMA_CC_FLASHDATA_ST_WIP 0x01 /* Write In Progress */ | ||
| 169 | #define BCMA_CC_FLASHDATA_ST_WEL 0x02 /* Write Enable Latch */ | ||
| 170 | #define BCMA_CC_FLASHDATA_ST_BP_MASK 0x1c /* Block Protect */ | ||
| 171 | #define BCMA_CC_FLASHDATA_ST_BP_SHIFT 2 | ||
| 172 | #define BCMA_CC_FLASHDATA_ST_SRWD 0x80 /* Status Register Write Disable */ | ||
| 173 | /* Status register bits for Atmel flashes */ | ||
| 174 | #define BCMA_CC_FLASHDATA_AT_READY 0x80 | ||
| 175 | #define BCMA_CC_FLASHDATA_AT_MISMATCH 0x40 | ||
| 176 | #define BCMA_CC_FLASHDATA_AT_ID_MASK 0x38 | ||
| 177 | #define BCMA_CC_FLASHDATA_AT_ID_SHIFT 3 | ||
| 124 | #define BCMA_CC_BCAST_ADDR 0x0050 | 178 | #define BCMA_CC_BCAST_ADDR 0x0050 |
| 125 | #define BCMA_CC_BCAST_DATA 0x0054 | 179 | #define BCMA_CC_BCAST_DATA 0x0054 |
| 126 | #define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ | 180 | #define BCMA_CC_GPIOPULLUP 0x0058 /* Rev >= 20 only */ |
| @@ -280,6 +334,15 @@ | |||
| 280 | 334 | ||
| 281 | /* 4706 PMU */ | 335 | /* 4706 PMU */ |
| 282 | #define BCMA_CC_PMU4706_MAINPLL_PLL0 0 | 336 | #define BCMA_CC_PMU4706_MAINPLL_PLL0 0 |
| 337 | #define BCMA_CC_PMU6_4706_PROCPLL_OFF 4 /* The CPU PLL */ | ||
| 338 | #define BCMA_CC_PMU6_4706_PROC_P2DIV_MASK 0x000f0000 | ||
| 339 | #define BCMA_CC_PMU6_4706_PROC_P2DIV_SHIFT 16 | ||
| 340 | #define BCMA_CC_PMU6_4706_PROC_P1DIV_MASK 0x0000f000 | ||
| 341 | #define BCMA_CC_PMU6_4706_PROC_P1DIV_SHIFT 12 | ||
| 342 | #define BCMA_CC_PMU6_4706_PROC_NDIV_INT_MASK 0x00000ff8 | ||
| 343 | #define BCMA_CC_PMU6_4706_PROC_NDIV_INT_SHIFT 3 | ||
| 344 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007 | ||
| 345 | #define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0 | ||
| 283 | 346 | ||
| 284 | /* ALP clock on pre-PMU chips */ | 347 | /* ALP clock on pre-PMU chips */ |
| 285 | #define BCMA_CC_PMU_ALP_CLOCK 20000000 | 348 | #define BCMA_CC_PMU_ALP_CLOCK 20000000 |
| @@ -308,6 +371,19 @@ | |||
| 308 | #define BCMA_CC_PPL_PCHI_OFF 5 | 371 | #define BCMA_CC_PPL_PCHI_OFF 5 |
| 309 | #define BCMA_CC_PPL_PCHI_MASK 0x0000003f | 372 | #define BCMA_CC_PPL_PCHI_MASK 0x0000003f |
| 310 | 373 | ||
| 374 | #define BCMA_CC_PMU_PLL_CTL0 0 | ||
| 375 | #define BCMA_CC_PMU_PLL_CTL1 1 | ||
| 376 | #define BCMA_CC_PMU_PLL_CTL2 2 | ||
| 377 | #define BCMA_CC_PMU_PLL_CTL3 3 | ||
| 378 | #define BCMA_CC_PMU_PLL_CTL4 4 | ||
| 379 | #define BCMA_CC_PMU_PLL_CTL5 5 | ||
| 380 | |||
| 381 | #define BCMA_CC_PMU1_PLL0_PC0_P1DIV_MASK 0x00f00000 | ||
| 382 | #define BCMA_CC_PMU1_PLL0_PC0_P1DIV_SHIFT 20 | ||
| 383 | |||
| 384 | #define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_MASK 0x1ff00000 | ||
| 385 | #define BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT 20 | ||
| 386 | |||
| 311 | /* BCM4331 ChipControl numbers. */ | 387 | /* BCM4331 ChipControl numbers. */ |
| 312 | #define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */ | 388 | #define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */ |
| 313 | #define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */ | 389 | #define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */ |
| @@ -321,9 +397,18 @@ | |||
| 321 | #define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */ | 397 | #define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */ |
| 322 | #define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */ | 398 | #define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */ |
| 323 | #define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */ | 399 | #define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */ |
| 400 | #define BCMA_CHIPCTL_4331_EXTPA_EN2 BIT(12) /* 0 ext pa disable, 1 ext pa enabled */ | ||
| 324 | #define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ | 401 | #define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ |
| 325 | #define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ | 402 | #define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ |
| 326 | 403 | ||
| 404 | /* 43224 chip-specific ChipControl register bits */ | ||
| 405 | #define BCMA_CCTRL_43224_GPIO_TOGGLE 0x8000 /* gpio[3:0] pins as btcoex or s/w gpio */ | ||
| 406 | #define BCMA_CCTRL_43224A0_12MA_LED_DRIVE 0x00F000F0 /* 12 mA drive strength */ | ||
| 407 | #define BCMA_CCTRL_43224B0_12MA_LED_DRIVE 0xF0 /* 12 mA drive strength for later 43224s */ | ||
| 408 | |||
| 409 | /* 4313 Chip specific ChipControl register bits */ | ||
| 410 | #define BCMA_CCTRL_4313_12MA_LED_DRIVE 0x00000007 /* 12 mA drive strengh for later 4313 */ | ||
| 411 | |||
| 327 | /* Data for the PMU, if available. | 412 | /* Data for the PMU, if available. |
| 328 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 413 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
| 329 | */ | 414 | */ |
| @@ -411,5 +496,6 @@ extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc, | |||
| 411 | u32 offset, u32 mask, u32 set); | 496 | u32 offset, u32 mask, u32 set); |
| 412 | extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, | 497 | extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, |
| 413 | u32 offset, u32 mask, u32 set); | 498 | u32 offset, u32 mask, u32 set); |
| 499 | extern void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid); | ||
| 414 | 500 | ||
| 415 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ | 501 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ |
diff --git a/include/linux/bcma/bcma_driver_gmac_cmn.h b/include/linux/bcma/bcma_driver_gmac_cmn.h new file mode 100644 index 000000000000..def894b83b0d --- /dev/null +++ b/include/linux/bcma/bcma_driver_gmac_cmn.h | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | #ifndef LINUX_BCMA_DRIVER_GMAC_CMN_H_ | ||
| 2 | #define LINUX_BCMA_DRIVER_GMAC_CMN_H_ | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | #define BCMA_GMAC_CMN_STAG0 0x000 | ||
| 7 | #define BCMA_GMAC_CMN_STAG1 0x004 | ||
| 8 | #define BCMA_GMAC_CMN_STAG2 0x008 | ||
| 9 | #define BCMA_GMAC_CMN_STAG3 0x00C | ||
| 10 | #define BCMA_GMAC_CMN_PARSER_CTL 0x020 | ||
| 11 | #define BCMA_GMAC_CMN_MIB_MAX_LEN 0x024 | ||
| 12 | #define BCMA_GMAC_CMN_PHY_ACCESS 0x100 | ||
| 13 | #define BCMA_GMAC_CMN_PA_DATA_MASK 0x0000ffff | ||
| 14 | #define BCMA_GMAC_CMN_PA_ADDR_MASK 0x001f0000 | ||
| 15 | #define BCMA_GMAC_CMN_PA_ADDR_SHIFT 16 | ||
| 16 | #define BCMA_GMAC_CMN_PA_REG_MASK 0x1f000000 | ||
| 17 | #define BCMA_GMAC_CMN_PA_REG_SHIFT 24 | ||
| 18 | #define BCMA_GMAC_CMN_PA_WRITE 0x20000000 | ||
| 19 | #define BCMA_GMAC_CMN_PA_START 0x40000000 | ||
| 20 | #define BCMA_GMAC_CMN_PHY_CTL 0x104 | ||
| 21 | #define BCMA_GMAC_CMN_PC_EPA_MASK 0x0000001f | ||
| 22 | #define BCMA_GMAC_CMN_PC_MCT_MASK 0x007f0000 | ||
| 23 | #define BCMA_GMAC_CMN_PC_MCT_SHIFT 16 | ||
| 24 | #define BCMA_GMAC_CMN_PC_MTE 0x00800000 | ||
| 25 | #define BCMA_GMAC_CMN_GMAC0_RGMII_CTL 0x110 | ||
| 26 | #define BCMA_GMAC_CMN_CFP_ACCESS 0x200 | ||
| 27 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA0 0x210 | ||
| 28 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA1 0x214 | ||
| 29 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA2 0x218 | ||
| 30 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA3 0x21C | ||
| 31 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA4 0x220 | ||
| 32 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA5 0x224 | ||
| 33 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA6 0x228 | ||
| 34 | #define BCMA_GMAC_CMN_CFP_TCAM_DATA7 0x22C | ||
| 35 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK0 0x230 | ||
| 36 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK1 0x234 | ||
| 37 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK2 0x238 | ||
| 38 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK3 0x23C | ||
| 39 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK4 0x240 | ||
| 40 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK5 0x244 | ||
| 41 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK6 0x248 | ||
| 42 | #define BCMA_GMAC_CMN_CFP_TCAM_MASK7 0x24C | ||
| 43 | #define BCMA_GMAC_CMN_CFP_ACTION_DATA 0x250 | ||
| 44 | #define BCMA_GMAC_CMN_TCAM_BIST_CTL 0x2A0 | ||
| 45 | #define BCMA_GMAC_CMN_TCAM_BIST_STATUS 0x2A4 | ||
| 46 | #define BCMA_GMAC_CMN_TCAM_CMP_STATUS 0x2A8 | ||
| 47 | #define BCMA_GMAC_CMN_TCAM_DISABLE 0x2AC | ||
| 48 | #define BCMA_GMAC_CMN_TCAM_TEST_CTL 0x2F0 | ||
| 49 | #define BCMA_GMAC_CMN_UDF_0_A3_A0 0x300 | ||
| 50 | #define BCMA_GMAC_CMN_UDF_0_A7_A4 0x304 | ||
| 51 | #define BCMA_GMAC_CMN_UDF_0_A8 0x308 | ||
| 52 | #define BCMA_GMAC_CMN_UDF_1_A3_A0 0x310 | ||
| 53 | #define BCMA_GMAC_CMN_UDF_1_A7_A4 0x314 | ||
| 54 | #define BCMA_GMAC_CMN_UDF_1_A8 0x318 | ||
| 55 | #define BCMA_GMAC_CMN_UDF_2_A3_A0 0x320 | ||
| 56 | #define BCMA_GMAC_CMN_UDF_2_A7_A4 0x324 | ||
| 57 | #define BCMA_GMAC_CMN_UDF_2_A8 0x328 | ||
| 58 | #define BCMA_GMAC_CMN_UDF_0_B3_B0 0x330 | ||
| 59 | #define BCMA_GMAC_CMN_UDF_0_B7_B4 0x334 | ||
| 60 | #define BCMA_GMAC_CMN_UDF_0_B8 0x338 | ||
| 61 | #define BCMA_GMAC_CMN_UDF_1_B3_B0 0x340 | ||
| 62 | #define BCMA_GMAC_CMN_UDF_1_B7_B4 0x344 | ||
| 63 | #define BCMA_GMAC_CMN_UDF_1_B8 0x348 | ||
| 64 | #define BCMA_GMAC_CMN_UDF_2_B3_B0 0x350 | ||
| 65 | #define BCMA_GMAC_CMN_UDF_2_B7_B4 0x354 | ||
| 66 | #define BCMA_GMAC_CMN_UDF_2_B8 0x358 | ||
| 67 | #define BCMA_GMAC_CMN_UDF_0_C3_C0 0x360 | ||
| 68 | #define BCMA_GMAC_CMN_UDF_0_C7_C4 0x364 | ||
| 69 | #define BCMA_GMAC_CMN_UDF_0_C8 0x368 | ||
| 70 | #define BCMA_GMAC_CMN_UDF_1_C3_C0 0x370 | ||
| 71 | #define BCMA_GMAC_CMN_UDF_1_C7_C4 0x374 | ||
| 72 | #define BCMA_GMAC_CMN_UDF_1_C8 0x378 | ||
| 73 | #define BCMA_GMAC_CMN_UDF_2_C3_C0 0x380 | ||
| 74 | #define BCMA_GMAC_CMN_UDF_2_C7_C4 0x384 | ||
| 75 | #define BCMA_GMAC_CMN_UDF_2_C8 0x388 | ||
| 76 | #define BCMA_GMAC_CMN_UDF_0_D3_D0 0x390 | ||
| 77 | #define BCMA_GMAC_CMN_UDF_0_D7_D4 0x394 | ||
| 78 | #define BCMA_GMAC_CMN_UDF_0_D11_D8 0x394 | ||
| 79 | |||
| 80 | struct bcma_drv_gmac_cmn { | ||
| 81 | struct bcma_device *core; | ||
| 82 | |||
| 83 | /* Drivers accessing BCMA_GMAC_CMN_PHY_ACCESS and | ||
| 84 | * BCMA_GMAC_CMN_PHY_CTL need to take that mutex first. */ | ||
| 85 | struct mutex phy_mutex; | ||
| 86 | }; | ||
| 87 | |||
| 88 | /* Register access */ | ||
| 89 | #define gmac_cmn_read16(gc, offset) bcma_read16((gc)->core, offset) | ||
| 90 | #define gmac_cmn_read32(gc, offset) bcma_read32((gc)->core, offset) | ||
| 91 | #define gmac_cmn_write16(gc, offset, val) bcma_write16((gc)->core, offset, val) | ||
| 92 | #define gmac_cmn_write32(gc, offset, val) bcma_write32((gc)->core, offset, val) | ||
| 93 | |||
| 94 | #ifdef CONFIG_BCMA_DRIVER_GMAC_CMN | ||
| 95 | extern void __devinit bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc); | ||
| 96 | #else | ||
| 97 | static inline void bcma_core_gmac_cmn_init(struct bcma_drv_gmac_cmn *gc) { } | ||
| 98 | #endif | ||
| 99 | |||
| 100 | #endif /* LINUX_BCMA_DRIVER_GMAC_CMN_H_ */ | ||
diff --git a/include/linux/can.h b/include/linux/can.h index 9a19bcb3eeaf..018055efc034 100644 --- a/include/linux/can.h +++ b/include/linux/can.h | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | /* special address description flags for the CAN_ID */ | 21 | /* special address description flags for the CAN_ID */ |
| 22 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ | 22 | #define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */ |
| 23 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ | 23 | #define CAN_RTR_FLAG 0x40000000U /* remote transmission request */ |
| 24 | #define CAN_ERR_FLAG 0x20000000U /* error frame */ | 24 | #define CAN_ERR_FLAG 0x20000000U /* error message frame */ |
| 25 | 25 | ||
| 26 | /* valid bits in CAN ID for frame formats */ | 26 | /* valid bits in CAN ID for frame formats */ |
| 27 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ | 27 | #define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */ |
| @@ -32,32 +32,84 @@ | |||
| 32 | * Controller Area Network Identifier structure | 32 | * Controller Area Network Identifier structure |
| 33 | * | 33 | * |
| 34 | * bit 0-28 : CAN identifier (11/29 bit) | 34 | * bit 0-28 : CAN identifier (11/29 bit) |
| 35 | * bit 29 : error frame flag (0 = data frame, 1 = error frame) | 35 | * bit 29 : error message frame flag (0 = data frame, 1 = error message) |
| 36 | * bit 30 : remote transmission request flag (1 = rtr frame) | 36 | * bit 30 : remote transmission request flag (1 = rtr frame) |
| 37 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) | 37 | * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit) |
| 38 | */ | 38 | */ |
| 39 | typedef __u32 canid_t; | 39 | typedef __u32 canid_t; |
| 40 | 40 | ||
| 41 | #define CAN_SFF_ID_BITS 11 | ||
| 42 | #define CAN_EFF_ID_BITS 29 | ||
| 43 | |||
| 41 | /* | 44 | /* |
| 42 | * Controller Area Network Error Frame Mask structure | 45 | * Controller Area Network Error Message Frame Mask structure |
| 43 | * | 46 | * |
| 44 | * bit 0-28 : error class mask (see include/linux/can/error.h) | 47 | * bit 0-28 : error class mask (see include/linux/can/error.h) |
| 45 | * bit 29-31 : set to zero | 48 | * bit 29-31 : set to zero |
| 46 | */ | 49 | */ |
| 47 | typedef __u32 can_err_mask_t; | 50 | typedef __u32 can_err_mask_t; |
| 48 | 51 | ||
| 52 | /* CAN payload length and DLC definitions according to ISO 11898-1 */ | ||
| 53 | #define CAN_MAX_DLC 8 | ||
| 54 | #define CAN_MAX_DLEN 8 | ||
| 55 | |||
| 56 | /* CAN FD payload length and DLC definitions according to ISO 11898-7 */ | ||
| 57 | #define CANFD_MAX_DLC 15 | ||
| 58 | #define CANFD_MAX_DLEN 64 | ||
| 59 | |||
| 49 | /** | 60 | /** |
| 50 | * struct can_frame - basic CAN frame structure | 61 | * struct can_frame - basic CAN frame structure |
| 51 | * @can_id: the CAN ID of the frame and CAN_*_FLAG flags, see above. | 62 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition |
| 52 | * @can_dlc: the data length field of the CAN frame | 63 | * @can_dlc: frame payload length in byte (0 .. 8) aka data length code |
| 53 | * @data: the CAN frame payload. | 64 | * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1 |
| 65 | * mapping of the 'data length code' to the real payload length | ||
| 66 | * @data: CAN frame payload (up to 8 byte) | ||
| 54 | */ | 67 | */ |
| 55 | struct can_frame { | 68 | struct can_frame { |
| 56 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | 69 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ |
| 57 | __u8 can_dlc; /* data length code: 0 .. 8 */ | 70 | __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ |
| 58 | __u8 data[8] __attribute__((aligned(8))); | 71 | __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8))); |
| 72 | }; | ||
| 73 | |||
| 74 | /* | ||
| 75 | * defined bits for canfd_frame.flags | ||
| 76 | * | ||
| 77 | * As the default for CAN FD should be to support the high data rate in the | ||
| 78 | * payload section of the frame (HDR) and to support up to 64 byte in the | ||
| 79 | * data section (EDL) the bits are only set in the non-default case. | ||
| 80 | * Btw. as long as there's no real implementation for CAN FD network driver | ||
| 81 | * these bits are only preliminary. | ||
| 82 | * | ||
| 83 | * RX: NOHDR/NOEDL - info about received CAN FD frame | ||
| 84 | * ESI - bit from originating CAN controller | ||
| 85 | * TX: NOHDR/NOEDL - control per-frame settings if supported by CAN controller | ||
| 86 | * ESI - bit is set by local CAN controller | ||
| 87 | */ | ||
| 88 | #define CANFD_NOHDR 0x01 /* frame without high data rate */ | ||
| 89 | #define CANFD_NOEDL 0x02 /* frame without extended data length */ | ||
| 90 | #define CANFD_ESI 0x04 /* error state indicator */ | ||
| 91 | |||
| 92 | /** | ||
| 93 | * struct canfd_frame - CAN flexible data rate frame structure | ||
| 94 | * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition | ||
| 95 | * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN) | ||
| 96 | * @flags: additional flags for CAN FD | ||
| 97 | * @__res0: reserved / padding | ||
| 98 | * @__res1: reserved / padding | ||
| 99 | * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte) | ||
| 100 | */ | ||
| 101 | struct canfd_frame { | ||
| 102 | canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ | ||
| 103 | __u8 len; /* frame payload length in byte */ | ||
| 104 | __u8 flags; /* additional flags for CAN FD */ | ||
| 105 | __u8 __res0; /* reserved / padding */ | ||
| 106 | __u8 __res1; /* reserved / padding */ | ||
| 107 | __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8))); | ||
| 59 | }; | 108 | }; |
| 60 | 109 | ||
| 110 | #define CAN_MTU (sizeof(struct can_frame)) | ||
| 111 | #define CANFD_MTU (sizeof(struct canfd_frame)) | ||
| 112 | |||
| 61 | /* particular protocols of the protocol family PF_CAN */ | 113 | /* particular protocols of the protocol family PF_CAN */ |
| 62 | #define CAN_RAW 1 /* RAW sockets */ | 114 | #define CAN_RAW 1 /* RAW sockets */ |
| 63 | #define CAN_BCM 2 /* Broadcast Manager */ | 115 | #define CAN_BCM 2 /* Broadcast Manager */ |
| @@ -97,7 +149,7 @@ struct sockaddr_can { | |||
| 97 | * <received_can_id> & mask == can_id & mask | 149 | * <received_can_id> & mask == can_id & mask |
| 98 | * | 150 | * |
| 99 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can | 151 | * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can |
| 100 | * filter for error frames (CAN_ERR_FLAG bit set in mask). | 152 | * filter for error message frames (CAN_ERR_FLAG bit set in mask). |
| 101 | */ | 153 | */ |
| 102 | struct can_filter { | 154 | struct can_filter { |
| 103 | canid_t can_id; | 155 | canid_t can_id; |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 0ccc1cd28b95..78c6c52073ad 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
| @@ -17,10 +17,10 @@ | |||
| 17 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
| 18 | #include <linux/netdevice.h> | 18 | #include <linux/netdevice.h> |
| 19 | 19 | ||
| 20 | #define CAN_VERSION "20090105" | 20 | #define CAN_VERSION "20120528" |
| 21 | 21 | ||
| 22 | /* increment this number each time you change some user-space interface */ | 22 | /* increment this number each time you change some user-space interface */ |
| 23 | #define CAN_ABI_VERSION "8" | 23 | #define CAN_ABI_VERSION "9" |
| 24 | 24 | ||
| 25 | #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION | 25 | #define CAN_VERSION_STRING "rev " CAN_VERSION " abi " CAN_ABI_VERSION |
| 26 | 26 | ||
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 5d2efe7e3f1b..2b2fc345afca 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -33,7 +33,7 @@ struct can_priv { | |||
| 33 | struct can_device_stats can_stats; | 33 | struct can_device_stats can_stats; |
| 34 | 34 | ||
| 35 | struct can_bittiming bittiming; | 35 | struct can_bittiming bittiming; |
| 36 | struct can_bittiming_const *bittiming_const; | 36 | const struct can_bittiming_const *bittiming_const; |
| 37 | struct can_clock clock; | 37 | struct can_clock clock; |
| 38 | 38 | ||
| 39 | enum can_state state; | 39 | enum can_state state; |
| @@ -61,23 +61,40 @@ struct can_priv { | |||
| 61 | * To be used in the CAN netdriver receive path to ensure conformance with | 61 | * To be used in the CAN netdriver receive path to ensure conformance with |
| 62 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) | 62 | * ISO 11898-1 Chapter 8.4.2.3 (DLC field) |
| 63 | */ | 63 | */ |
| 64 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | 64 | #define get_can_dlc(i) (min_t(__u8, (i), CAN_MAX_DLC)) |
| 65 | #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) | ||
| 65 | 66 | ||
| 66 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ | 67 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ |
| 67 | static inline int can_dropped_invalid_skb(struct net_device *dev, | 68 | static inline int can_dropped_invalid_skb(struct net_device *dev, |
| 68 | struct sk_buff *skb) | 69 | struct sk_buff *skb) |
| 69 | { | 70 | { |
| 70 | const struct can_frame *cf = (struct can_frame *)skb->data; | 71 | const struct canfd_frame *cfd = (struct canfd_frame *)skb->data; |
| 71 | 72 | ||
| 72 | if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { | 73 | if (skb->protocol == htons(ETH_P_CAN)) { |
| 73 | kfree_skb(skb); | 74 | if (unlikely(skb->len != CAN_MTU || |
| 74 | dev->stats.tx_dropped++; | 75 | cfd->len > CAN_MAX_DLEN)) |
| 75 | return 1; | 76 | goto inval_skb; |
| 76 | } | 77 | } else if (skb->protocol == htons(ETH_P_CANFD)) { |
| 78 | if (unlikely(skb->len != CANFD_MTU || | ||
| 79 | cfd->len > CANFD_MAX_DLEN)) | ||
| 80 | goto inval_skb; | ||
| 81 | } else | ||
| 82 | goto inval_skb; | ||
| 77 | 83 | ||
| 78 | return 0; | 84 | return 0; |
| 85 | |||
| 86 | inval_skb: | ||
| 87 | kfree_skb(skb); | ||
| 88 | dev->stats.tx_dropped++; | ||
| 89 | return 1; | ||
| 79 | } | 90 | } |
| 80 | 91 | ||
| 92 | /* get data length from can_dlc with sanitized can_dlc */ | ||
| 93 | u8 can_dlc2len(u8 can_dlc); | ||
| 94 | |||
| 95 | /* map the sanitized data length to an appropriate data length code */ | ||
| 96 | u8 can_len2dlc(u8 len); | ||
| 97 | |||
| 81 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 98 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
| 82 | void free_candev(struct net_device *dev); | 99 | void free_candev(struct net_device *dev); |
| 83 | 100 | ||
diff --git a/include/linux/can/error.h b/include/linux/can/error.h index 63e855ea6b84..7b7148bded71 100644 --- a/include/linux/can/error.h +++ b/include/linux/can/error.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/can/error.h | 2 | * linux/can/error.h |
| 3 | * | 3 | * |
| 4 | * Definitions of the CAN error frame to be filtered and passed to the user. | 4 | * Definitions of the CAN error messages to be filtered and passed to the user. |
| 5 | * | 5 | * |
| 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> |
| 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| @@ -12,7 +12,7 @@ | |||
| 12 | #ifndef CAN_ERROR_H | 12 | #ifndef CAN_ERROR_H |
| 13 | #define CAN_ERROR_H | 13 | #define CAN_ERROR_H |
| 14 | 14 | ||
| 15 | #define CAN_ERR_DLC 8 /* dlc for error frames */ | 15 | #define CAN_ERR_DLC 8 /* dlc for error message frames */ |
| 16 | 16 | ||
| 17 | /* error class (mask) in can_id */ | 17 | /* error class (mask) in can_id */ |
| 18 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ | 18 | #define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */ |
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h index 781f3a3701be..a814062b0719 100644 --- a/include/linux/can/raw.h +++ b/include/linux/can/raw.h | |||
| @@ -23,7 +23,8 @@ enum { | |||
| 23 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ | 23 | CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */ |
| 24 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ | 24 | CAN_RAW_ERR_FILTER, /* set filter for error frames */ |
| 25 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ | 25 | CAN_RAW_LOOPBACK, /* local loopback (default:on) */ |
| 26 | CAN_RAW_RECV_OWN_MSGS /* receive my own msgs (default:off) */ | 26 | CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */ |
| 27 | CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */ | ||
| 27 | }; | 28 | }; |
| 28 | 29 | ||
| 29 | #endif | 30 | #endif |
diff --git a/include/linux/clk.h b/include/linux/clk.h index ad5c43e8ae8a..f6fb40c8bf97 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
| @@ -86,7 +86,7 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); | |||
| 86 | /** | 86 | /** |
| 87 | * clk_get - lookup and obtain a reference to a clock producer. | 87 | * clk_get - lookup and obtain a reference to a clock producer. |
| 88 | * @dev: device for clock "consumer" | 88 | * @dev: device for clock "consumer" |
| 89 | * @id: clock comsumer ID | 89 | * @id: clock consumer ID |
| 90 | * | 90 | * |
| 91 | * Returns a struct clk corresponding to the clock producer, or | 91 | * Returns a struct clk corresponding to the clock producer, or |
| 92 | * valid IS_ERR() condition containing errno. The implementation | 92 | * valid IS_ERR() condition containing errno. The implementation |
| @@ -103,7 +103,7 @@ struct clk *clk_get(struct device *dev, const char *id); | |||
| 103 | /** | 103 | /** |
| 104 | * devm_clk_get - lookup and obtain a managed reference to a clock producer. | 104 | * devm_clk_get - lookup and obtain a managed reference to a clock producer. |
| 105 | * @dev: device for clock "consumer" | 105 | * @dev: device for clock "consumer" |
| 106 | * @id: clock comsumer ID | 106 | * @id: clock consumer ID |
| 107 | * | 107 | * |
| 108 | * Returns a struct clk corresponding to the clock producer, or | 108 | * Returns a struct clk corresponding to the clock producer, or |
| 109 | * valid IS_ERR() condition containing errno. The implementation | 109 | * valid IS_ERR() condition containing errno. The implementation |
diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h index 473771a528c0..ac3bbb5b9502 100644 --- a/include/linux/cpu_rmap.h +++ b/include/linux/cpu_rmap.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef __LINUX_CPU_RMAP_H | ||
| 2 | #define __LINUX_CPU_RMAP_H | ||
| 3 | |||
| 1 | /* | 4 | /* |
| 2 | * cpu_rmap.c: CPU affinity reverse-map support | 5 | * cpu_rmap.c: CPU affinity reverse-map support |
| 3 | * Copyright 2011 Solarflare Communications Inc. | 6 | * Copyright 2011 Solarflare Communications Inc. |
| @@ -71,3 +74,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap); | |||
| 71 | extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); | 74 | extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); |
| 72 | 75 | ||
| 73 | #endif | 76 | #endif |
| 77 | #endif /* __LINUX_CPU_RMAP_H */ | ||
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 56377df39124..cc0756a35ae3 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
| @@ -670,6 +670,12 @@ static inline int dmaengine_resume(struct dma_chan *chan) | |||
| 670 | return dmaengine_device_control(chan, DMA_RESUME, 0); | 670 | return dmaengine_device_control(chan, DMA_RESUME, 0); |
| 671 | } | 671 | } |
| 672 | 672 | ||
| 673 | static inline enum dma_status dmaengine_tx_status(struct dma_chan *chan, | ||
| 674 | dma_cookie_t cookie, struct dma_tx_state *state) | ||
| 675 | { | ||
| 676 | return chan->device->device_tx_status(chan, cookie, state); | ||
| 677 | } | ||
| 678 | |||
| 673 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) | 679 | static inline dma_cookie_t dmaengine_submit(struct dma_async_tx_descriptor *desc) |
| 674 | { | 680 | { |
| 675 | return desc->tx_submit(desc); | 681 | return desc->tx_submit(desc); |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 3d406e0ede6d..d426336d92d9 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr) | |||
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | /** | 126 | /** |
| 127 | * random_ether_addr - Generate software assigned random Ethernet address | 127 | * eth_random_addr - Generate software assigned random Ethernet address |
| 128 | * @addr: Pointer to a six-byte array containing the Ethernet address | 128 | * @addr: Pointer to a six-byte array containing the Ethernet address |
| 129 | * | 129 | * |
| 130 | * Generate a random Ethernet address (MAC) that is not multicast | 130 | * Generate a random Ethernet address (MAC) that is not multicast |
| 131 | * and has the local assigned bit set. | 131 | * and has the local assigned bit set. |
| 132 | */ | 132 | */ |
| 133 | static inline void random_ether_addr(u8 *addr) | 133 | static inline void eth_random_addr(u8 *addr) |
| 134 | { | 134 | { |
| 135 | get_random_bytes (addr, ETH_ALEN); | 135 | get_random_bytes(addr, ETH_ALEN); |
| 136 | addr [0] &= 0xfe; /* clear multicast bit */ | 136 | addr[0] &= 0xfe; /* clear multicast bit */ |
| 137 | addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ | 137 | addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ |
| 138 | } | ||
| 139 | |||
| 140 | #define random_ether_addr(addr) eth_random_addr(addr) | ||
| 141 | |||
| 142 | /** | ||
| 143 | * eth_broadcast_addr - Assign broadcast address | ||
| 144 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
| 145 | * | ||
| 146 | * Assign the broadcast address to the given address array. | ||
| 147 | */ | ||
| 148 | static inline void eth_broadcast_addr(u8 *addr) | ||
| 149 | { | ||
| 150 | memset(addr, 0xff, ETH_ALEN); | ||
| 138 | } | 151 | } |
| 139 | 152 | ||
| 140 | /** | 153 | /** |
| @@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr) | |||
| 149 | static inline void eth_hw_addr_random(struct net_device *dev) | 162 | static inline void eth_hw_addr_random(struct net_device *dev) |
| 150 | { | 163 | { |
| 151 | dev->addr_assign_type |= NET_ADDR_RANDOM; | 164 | dev->addr_assign_type |= NET_ADDR_RANDOM; |
| 152 | random_ether_addr(dev->dev_addr); | 165 | eth_random_addr(dev->dev_addr); |
| 153 | } | 166 | } |
| 154 | 167 | ||
| 155 | /** | 168 | /** |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index e17fa7140588..21eff418091b 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -137,6 +137,35 @@ struct ethtool_eeprom { | |||
| 137 | }; | 137 | }; |
| 138 | 138 | ||
| 139 | /** | 139 | /** |
| 140 | * struct ethtool_eee - Energy Efficient Ethernet information | ||
| 141 | * @cmd: ETHTOOL_{G,S}EEE | ||
| 142 | * @supported: Mask of %SUPPORTED_* flags for the speed/duplex combinations | ||
| 143 | * for which there is EEE support. | ||
| 144 | * @advertised: Mask of %ADVERTISED_* flags for the speed/duplex combinations | ||
| 145 | * advertised as eee capable. | ||
| 146 | * @lp_advertised: Mask of %ADVERTISED_* flags for the speed/duplex | ||
| 147 | * combinations advertised by the link partner as eee capable. | ||
| 148 | * @eee_active: Result of the eee auto negotiation. | ||
| 149 | * @eee_enabled: EEE configured mode (enabled/disabled). | ||
| 150 | * @tx_lpi_enabled: Whether the interface should assert its tx lpi, given | ||
| 151 | * that eee was negotiated. | ||
| 152 | * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting | ||
| 153 | * its tx lpi (after reaching 'idle' state). Effective only when eee | ||
| 154 | * was negotiated and tx_lpi_enabled was set. | ||
| 155 | */ | ||
| 156 | struct ethtool_eee { | ||
| 157 | __u32 cmd; | ||
| 158 | __u32 supported; | ||
| 159 | __u32 advertised; | ||
| 160 | __u32 lp_advertised; | ||
| 161 | __u32 eee_active; | ||
| 162 | __u32 eee_enabled; | ||
| 163 | __u32 tx_lpi_enabled; | ||
| 164 | __u32 tx_lpi_timer; | ||
| 165 | __u32 reserved[2]; | ||
| 166 | }; | ||
| 167 | |||
| 168 | /** | ||
| 140 | * struct ethtool_modinfo - plugin module eeprom information | 169 | * struct ethtool_modinfo - plugin module eeprom information |
| 141 | * @cmd: %ETHTOOL_GMODULEINFO | 170 | * @cmd: %ETHTOOL_GMODULEINFO |
| 142 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx | 171 | * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx |
| @@ -945,6 +974,8 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) | |||
| 945 | * @get_module_info: Get the size and type of the eeprom contained within | 974 | * @get_module_info: Get the size and type of the eeprom contained within |
| 946 | * a plug-in module. | 975 | * a plug-in module. |
| 947 | * @get_module_eeprom: Get the eeprom information from the plug-in module | 976 | * @get_module_eeprom: Get the eeprom information from the plug-in module |
| 977 | * @get_eee: Get Energy-Efficient (EEE) supported and status. | ||
| 978 | * @set_eee: Set EEE status (enable/disable) as well as LPI timers. | ||
| 948 | * | 979 | * |
| 949 | * All operations are optional (i.e. the function pointer may be set | 980 | * All operations are optional (i.e. the function pointer may be set |
| 950 | * to %NULL) and callers must take this into account. Callers must | 981 | * to %NULL) and callers must take this into account. Callers must |
| @@ -1011,6 +1042,8 @@ struct ethtool_ops { | |||
| 1011 | struct ethtool_modinfo *); | 1042 | struct ethtool_modinfo *); |
| 1012 | int (*get_module_eeprom)(struct net_device *, | 1043 | int (*get_module_eeprom)(struct net_device *, |
| 1013 | struct ethtool_eeprom *, u8 *); | 1044 | struct ethtool_eeprom *, u8 *); |
| 1045 | int (*get_eee)(struct net_device *, struct ethtool_eee *); | ||
| 1046 | int (*set_eee)(struct net_device *, struct ethtool_eee *); | ||
| 1014 | 1047 | ||
| 1015 | 1048 | ||
| 1016 | }; | 1049 | }; |
| @@ -1089,6 +1122,8 @@ struct ethtool_ops { | |||
| 1089 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ | 1122 | #define ETHTOOL_GET_TS_INFO 0x00000041 /* Get time stamping and PHC info */ |
| 1090 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ | 1123 | #define ETHTOOL_GMODULEINFO 0x00000042 /* Get plug-in module information */ |
| 1091 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ | 1124 | #define ETHTOOL_GMODULEEEPROM 0x00000043 /* Get plug-in module eeprom */ |
| 1125 | #define ETHTOOL_GEEE 0x00000044 /* Get EEE settings */ | ||
| 1126 | #define ETHTOOL_SEEE 0x00000045 /* Set EEE settings */ | ||
| 1092 | 1127 | ||
| 1093 | /* compatibility with older code */ | 1128 | /* compatibility with older code */ |
| 1094 | #define SPARC_ETH_GSET ETHTOOL_GSET | 1129 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| @@ -1118,6 +1153,10 @@ struct ethtool_ops { | |||
| 1118 | #define SUPPORTED_10000baseR_FEC (1 << 20) | 1153 | #define SUPPORTED_10000baseR_FEC (1 << 20) |
| 1119 | #define SUPPORTED_20000baseMLD2_Full (1 << 21) | 1154 | #define SUPPORTED_20000baseMLD2_Full (1 << 21) |
| 1120 | #define SUPPORTED_20000baseKR2_Full (1 << 22) | 1155 | #define SUPPORTED_20000baseKR2_Full (1 << 22) |
| 1156 | #define SUPPORTED_40000baseKR4_Full (1 << 23) | ||
| 1157 | #define SUPPORTED_40000baseCR4_Full (1 << 24) | ||
| 1158 | #define SUPPORTED_40000baseSR4_Full (1 << 25) | ||
| 1159 | #define SUPPORTED_40000baseLR4_Full (1 << 26) | ||
| 1121 | 1160 | ||
| 1122 | /* Indicates what features are advertised by the interface. */ | 1161 | /* Indicates what features are advertised by the interface. */ |
| 1123 | #define ADVERTISED_10baseT_Half (1 << 0) | 1162 | #define ADVERTISED_10baseT_Half (1 << 0) |
| @@ -1143,6 +1182,10 @@ struct ethtool_ops { | |||
| 1143 | #define ADVERTISED_10000baseR_FEC (1 << 20) | 1182 | #define ADVERTISED_10000baseR_FEC (1 << 20) |
| 1144 | #define ADVERTISED_20000baseMLD2_Full (1 << 21) | 1183 | #define ADVERTISED_20000baseMLD2_Full (1 << 21) |
| 1145 | #define ADVERTISED_20000baseKR2_Full (1 << 22) | 1184 | #define ADVERTISED_20000baseKR2_Full (1 << 22) |
| 1185 | #define ADVERTISED_40000baseKR4_Full (1 << 23) | ||
| 1186 | #define ADVERTISED_40000baseCR4_Full (1 << 24) | ||
| 1187 | #define ADVERTISED_40000baseSR4_Full (1 << 25) | ||
| 1188 | #define ADVERTISED_40000baseLR4_Full (1 << 26) | ||
| 1146 | 1189 | ||
| 1147 | /* The following are all involved in forcing a particular link | 1190 | /* The following are all involved in forcing a particular link |
| 1148 | * mode for the device for setting things. When getting the | 1191 | * mode for the device for setting things. When getting the |
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 7a114016ac7d..5ab61c1eb6bf 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h | |||
| @@ -85,7 +85,7 @@ enum { | |||
| 85 | /* All generic netlink requests are serialized by a global lock. */ | 85 | /* All generic netlink requests are serialized by a global lock. */ |
| 86 | extern void genl_lock(void); | 86 | extern void genl_lock(void); |
| 87 | extern void genl_unlock(void); | 87 | extern void genl_unlock(void); |
| 88 | #ifdef CONFIG_PROVE_LOCKING | 88 | #ifdef CONFIG_LOCKDEP |
| 89 | extern int lockdep_genl_is_held(void); | 89 | extern int lockdep_genl_is_held(void); |
| 90 | #endif | 90 | #endif |
| 91 | 91 | ||
diff --git a/include/linux/hid.h b/include/linux/hid.h index 449fa385703d..42970de1b40c 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -200,6 +200,7 @@ struct hid_item { | |||
| 200 | #define HID_UP_DIGITIZER 0x000d0000 | 200 | #define HID_UP_DIGITIZER 0x000d0000 |
| 201 | #define HID_UP_PID 0x000f0000 | 201 | #define HID_UP_PID 0x000f0000 |
| 202 | #define HID_UP_HPVENDOR 0xff7f0000 | 202 | #define HID_UP_HPVENDOR 0xff7f0000 |
| 203 | #define HID_UP_HPVENDOR2 0xff010000 | ||
| 203 | #define HID_UP_MSVENDOR 0xff000000 | 204 | #define HID_UP_MSVENDOR 0xff000000 |
| 204 | #define HID_UP_CUSTOM 0x00ff0000 | 205 | #define HID_UP_CUSTOM 0x00ff0000 |
| 205 | #define HID_UP_LOGIVENDOR 0xffbc0000 | 206 | #define HID_UP_LOGIVENDOR 0xffbc0000 |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index ce9af8918514..e02fc682bb68 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -47,6 +47,7 @@ | |||
| 47 | #define IEEE80211_FCTL_MOREDATA 0x2000 | 47 | #define IEEE80211_FCTL_MOREDATA 0x2000 |
| 48 | #define IEEE80211_FCTL_PROTECTED 0x4000 | 48 | #define IEEE80211_FCTL_PROTECTED 0x4000 |
| 49 | #define IEEE80211_FCTL_ORDER 0x8000 | 49 | #define IEEE80211_FCTL_ORDER 0x8000 |
| 50 | #define IEEE80211_FCTL_CTL_EXT 0x0f00 | ||
| 50 | 51 | ||
| 51 | #define IEEE80211_SCTL_FRAG 0x000F | 52 | #define IEEE80211_SCTL_FRAG 0x000F |
| 52 | #define IEEE80211_SCTL_SEQ 0xFFF0 | 53 | #define IEEE80211_SCTL_SEQ 0xFFF0 |
| @@ -54,6 +55,7 @@ | |||
| 54 | #define IEEE80211_FTYPE_MGMT 0x0000 | 55 | #define IEEE80211_FTYPE_MGMT 0x0000 |
| 55 | #define IEEE80211_FTYPE_CTL 0x0004 | 56 | #define IEEE80211_FTYPE_CTL 0x0004 |
| 56 | #define IEEE80211_FTYPE_DATA 0x0008 | 57 | #define IEEE80211_FTYPE_DATA 0x0008 |
| 58 | #define IEEE80211_FTYPE_EXT 0x000c | ||
| 57 | 59 | ||
| 58 | /* management */ | 60 | /* management */ |
| 59 | #define IEEE80211_STYPE_ASSOC_REQ 0x0000 | 61 | #define IEEE80211_STYPE_ASSOC_REQ 0x0000 |
| @@ -70,6 +72,7 @@ | |||
| 70 | #define IEEE80211_STYPE_ACTION 0x00D0 | 72 | #define IEEE80211_STYPE_ACTION 0x00D0 |
| 71 | 73 | ||
| 72 | /* control */ | 74 | /* control */ |
| 75 | #define IEEE80211_STYPE_CTL_EXT 0x0060 | ||
| 73 | #define IEEE80211_STYPE_BACK_REQ 0x0080 | 76 | #define IEEE80211_STYPE_BACK_REQ 0x0080 |
| 74 | #define IEEE80211_STYPE_BACK 0x0090 | 77 | #define IEEE80211_STYPE_BACK 0x0090 |
| 75 | #define IEEE80211_STYPE_PSPOLL 0x00A0 | 78 | #define IEEE80211_STYPE_PSPOLL 0x00A0 |
| @@ -97,6 +100,18 @@ | |||
| 97 | #define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 | 100 | #define IEEE80211_STYPE_QOS_CFPOLL 0x00E0 |
| 98 | #define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 | 101 | #define IEEE80211_STYPE_QOS_CFACKPOLL 0x00F0 |
| 99 | 102 | ||
| 103 | /* extension, added by 802.11ad */ | ||
| 104 | #define IEEE80211_STYPE_DMG_BEACON 0x0000 | ||
| 105 | |||
| 106 | /* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */ | ||
| 107 | #define IEEE80211_CTL_EXT_POLL 0x2000 | ||
| 108 | #define IEEE80211_CTL_EXT_SPR 0x3000 | ||
| 109 | #define IEEE80211_CTL_EXT_GRANT 0x4000 | ||
| 110 | #define IEEE80211_CTL_EXT_DMG_CTS 0x5000 | ||
| 111 | #define IEEE80211_CTL_EXT_DMG_DTS 0x6000 | ||
| 112 | #define IEEE80211_CTL_EXT_SSW 0x8000 | ||
| 113 | #define IEEE80211_CTL_EXT_SSW_FBACK 0x9000 | ||
| 114 | #define IEEE80211_CTL_EXT_SSW_ACK 0xa000 | ||
| 100 | 115 | ||
| 101 | /* miscellaneous IEEE 802.11 constants */ | 116 | /* miscellaneous IEEE 802.11 constants */ |
| 102 | #define IEEE80211_MAX_FRAG_THRESHOLD 2352 | 117 | #define IEEE80211_MAX_FRAG_THRESHOLD 2352 |
| @@ -568,6 +583,26 @@ struct ieee80211s_hdr { | |||
| 568 | #define MESH_FLAGS_PS_DEEP 0x4 | 583 | #define MESH_FLAGS_PS_DEEP 0x4 |
| 569 | 584 | ||
| 570 | /** | 585 | /** |
| 586 | * enum ieee80211_preq_flags - mesh PREQ element flags | ||
| 587 | * | ||
| 588 | * @IEEE80211_PREQ_PROACTIVE_PREP_FLAG: proactive PREP subfield | ||
| 589 | */ | ||
| 590 | enum ieee80211_preq_flags { | ||
| 591 | IEEE80211_PREQ_PROACTIVE_PREP_FLAG = 1<<2, | ||
| 592 | }; | ||
| 593 | |||
| 594 | /** | ||
| 595 | * enum ieee80211_preq_target_flags - mesh PREQ element per target flags | ||
| 596 | * | ||
| 597 | * @IEEE80211_PREQ_TO_FLAG: target only subfield | ||
| 598 | * @IEEE80211_PREQ_USN_FLAG: unknown target HWMP sequence number subfield | ||
| 599 | */ | ||
| 600 | enum ieee80211_preq_target_flags { | ||
| 601 | IEEE80211_PREQ_TO_FLAG = 1<<0, | ||
| 602 | IEEE80211_PREQ_USN_FLAG = 1<<2, | ||
| 603 | }; | ||
| 604 | |||
| 605 | /** | ||
| 571 | * struct ieee80211_quiet_ie | 606 | * struct ieee80211_quiet_ie |
| 572 | * | 607 | * |
| 573 | * This structure refers to "Quiet information element" | 608 | * This structure refers to "Quiet information element" |
| @@ -1072,6 +1107,73 @@ struct ieee80211_ht_operation { | |||
| 1072 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 | 1107 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 |
| 1073 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 | 1108 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 |
| 1074 | 1109 | ||
| 1110 | #define VHT_MCS_SUPPORTED_SET_SIZE 8 | ||
| 1111 | |||
| 1112 | struct ieee80211_vht_capabilities { | ||
| 1113 | __le32 vht_capabilities_info; | ||
| 1114 | u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE]; | ||
| 1115 | } __packed; | ||
| 1116 | |||
| 1117 | struct ieee80211_vht_operation { | ||
| 1118 | u8 vht_op_info_chwidth; | ||
| 1119 | u8 vht_op_info_chan_center_freq_seg1_idx; | ||
| 1120 | u8 vht_op_info_chan_center_freq_seg2_idx; | ||
| 1121 | __le16 vht_basic_mcs_set; | ||
| 1122 | } __packed; | ||
| 1123 | |||
| 1124 | /** | ||
| 1125 | * struct ieee80211_vht_mcs_info - VHT MCS information | ||
| 1126 | * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams | ||
| 1127 | * @rx_highest: Indicates highest long GI VHT PPDU data rate | ||
| 1128 | * STA can receive. Rate expressed in units of 1 Mbps. | ||
| 1129 | * If this field is 0 this value should not be used to | ||
| 1130 | * consider the highest RX data rate supported. | ||
| 1131 | * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams | ||
| 1132 | * @tx_highest: Indicates highest long GI VHT PPDU data rate | ||
| 1133 | * STA can transmit. Rate expressed in units of 1 Mbps. | ||
| 1134 | * If this field is 0 this value should not be used to | ||
| 1135 | * consider the highest TX data rate supported. | ||
| 1136 | */ | ||
| 1137 | struct ieee80211_vht_mcs_info { | ||
| 1138 | __le16 rx_mcs_map; | ||
| 1139 | __le16 rx_highest; | ||
| 1140 | __le16 tx_mcs_map; | ||
| 1141 | __le16 tx_highest; | ||
| 1142 | } __packed; | ||
| 1143 | |||
| 1144 | #define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 | ||
| 1145 | #define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 | ||
| 1146 | #define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 | ||
| 1147 | #define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 | ||
| 1148 | |||
| 1149 | /* 802.11ac VHT Capabilities */ | ||
| 1150 | #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 | ||
| 1151 | #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 | ||
| 1152 | #define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 | ||
| 1153 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 | ||
| 1154 | #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 | ||
| 1155 | #define IEEE80211_VHT_CAP_RXLDPC 0x00000010 | ||
| 1156 | #define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 | ||
| 1157 | #define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 | ||
| 1158 | #define IEEE80211_VHT_CAP_TXSTBC 0x00000080 | ||
| 1159 | #define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 | ||
| 1160 | #define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 | ||
| 1161 | #define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 | ||
| 1162 | #define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 | ||
| 1163 | #define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 | ||
| 1164 | #define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 | ||
| 1165 | #define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 | ||
| 1166 | #define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 | ||
| 1167 | #define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 | ||
| 1168 | #define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 | ||
| 1169 | #define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 | ||
| 1170 | #define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 | ||
| 1171 | #define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000 | ||
| 1172 | #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 | ||
| 1173 | #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 | ||
| 1174 | #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 | ||
| 1175 | #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 | ||
| 1176 | |||
| 1075 | /* Authentication algorithms */ | 1177 | /* Authentication algorithms */ |
| 1076 | #define WLAN_AUTH_OPEN 0 | 1178 | #define WLAN_AUTH_OPEN 0 |
| 1077 | #define WLAN_AUTH_SHARED_KEY 1 | 1179 | #define WLAN_AUTH_SHARED_KEY 1 |
| @@ -1104,6 +1206,21 @@ struct ieee80211_ht_operation { | |||
| 1104 | #define WLAN_CAPABILITY_QOS (1<<9) | 1206 | #define WLAN_CAPABILITY_QOS (1<<9) |
| 1105 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) | 1207 | #define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) |
| 1106 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) | 1208 | #define WLAN_CAPABILITY_DSSS_OFDM (1<<13) |
| 1209 | |||
| 1210 | /* DMG (60gHz) 802.11ad */ | ||
| 1211 | /* type - bits 0..1 */ | ||
| 1212 | #define WLAN_CAPABILITY_DMG_TYPE_IBSS (1<<0) /* Tx by: STA */ | ||
| 1213 | #define WLAN_CAPABILITY_DMG_TYPE_PBSS (2<<0) /* Tx by: PCP */ | ||
| 1214 | #define WLAN_CAPABILITY_DMG_TYPE_AP (3<<0) /* Tx by: AP */ | ||
| 1215 | |||
| 1216 | #define WLAN_CAPABILITY_DMG_CBAP_ONLY (1<<2) | ||
| 1217 | #define WLAN_CAPABILITY_DMG_CBAP_SOURCE (1<<3) | ||
| 1218 | #define WLAN_CAPABILITY_DMG_PRIVACY (1<<4) | ||
| 1219 | #define WLAN_CAPABILITY_DMG_ECPAC (1<<5) | ||
| 1220 | |||
| 1221 | #define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT (1<<8) | ||
| 1222 | #define WLAN_CAPABILITY_DMG_RADIO_MEASURE (1<<12) | ||
| 1223 | |||
| 1107 | /* measurement */ | 1224 | /* measurement */ |
| 1108 | #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) | 1225 | #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0) |
| 1109 | #define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) | 1226 | #define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1) |
| @@ -1113,7 +1230,6 @@ struct ieee80211_ht_operation { | |||
| 1113 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 | 1230 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1 |
| 1114 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 | 1231 | #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2 |
| 1115 | 1232 | ||
| 1116 | |||
| 1117 | /* 802.11g ERP information element */ | 1233 | /* 802.11g ERP information element */ |
| 1118 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) | 1234 | #define WLAN_ERP_NON_ERP_PRESENT (1<<0) |
| 1119 | #define WLAN_ERP_USE_PROTECTION (1<<1) | 1235 | #define WLAN_ERP_USE_PROTECTION (1<<1) |
| @@ -1125,6 +1241,16 @@ enum { | |||
| 1125 | WLAN_ERP_PREAMBLE_LONG = 1, | 1241 | WLAN_ERP_PREAMBLE_LONG = 1, |
| 1126 | }; | 1242 | }; |
| 1127 | 1243 | ||
| 1244 | /* Band ID, 802.11ad #8.4.1.45 */ | ||
| 1245 | enum { | ||
| 1246 | IEEE80211_BANDID_TV_WS = 0, /* TV white spaces */ | ||
| 1247 | IEEE80211_BANDID_SUB1 = 1, /* Sub-1 GHz (excluding TV white spaces) */ | ||
| 1248 | IEEE80211_BANDID_2G = 2, /* 2.4 GHz */ | ||
| 1249 | IEEE80211_BANDID_3G = 3, /* 3.6 GHz */ | ||
| 1250 | IEEE80211_BANDID_5G = 4, /* 4.9 and 5 GHz */ | ||
| 1251 | IEEE80211_BANDID_60G = 5, /* 60 GHz */ | ||
| 1252 | }; | ||
| 1253 | |||
| 1128 | /* Status codes */ | 1254 | /* Status codes */ |
| 1129 | enum ieee80211_statuscode { | 1255 | enum ieee80211_statuscode { |
| 1130 | WLAN_STATUS_SUCCESS = 0, | 1256 | WLAN_STATUS_SUCCESS = 0, |
| @@ -1176,6 +1302,17 @@ enum ieee80211_statuscode { | |||
| 1176 | WLAN_STATUS_ANTI_CLOG_REQUIRED = 76, | 1302 | WLAN_STATUS_ANTI_CLOG_REQUIRED = 76, |
| 1177 | WLAN_STATUS_FCG_NOT_SUPP = 78, | 1303 | WLAN_STATUS_FCG_NOT_SUPP = 78, |
| 1178 | WLAN_STATUS_STA_NO_TBTT = 78, | 1304 | WLAN_STATUS_STA_NO_TBTT = 78, |
| 1305 | /* 802.11ad */ | ||
| 1306 | WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39, | ||
| 1307 | WLAN_STATUS_REJECTED_FOR_DELAY_PERIOD = 47, | ||
| 1308 | WLAN_STATUS_REJECT_WITH_SCHEDULE = 83, | ||
| 1309 | WLAN_STATUS_PENDING_ADMITTING_FST_SESSION = 86, | ||
| 1310 | WLAN_STATUS_PERFORMING_FST_NOW = 87, | ||
| 1311 | WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW = 88, | ||
| 1312 | WLAN_STATUS_REJECT_U_PID_SETTING = 89, | ||
| 1313 | WLAN_STATUS_REJECT_DSE_BAND = 96, | ||
| 1314 | WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99, | ||
| 1315 | WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103, | ||
| 1179 | }; | 1316 | }; |
| 1180 | 1317 | ||
| 1181 | 1318 | ||
| @@ -1332,6 +1469,43 @@ enum ieee80211_eid { | |||
| 1332 | WLAN_EID_DSE_REGISTERED_LOCATION = 58, | 1469 | WLAN_EID_DSE_REGISTERED_LOCATION = 58, |
| 1333 | WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, | 1470 | WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, |
| 1334 | WLAN_EID_EXT_CHANSWITCH_ANN = 60, | 1471 | WLAN_EID_EXT_CHANSWITCH_ANN = 60, |
| 1472 | |||
| 1473 | WLAN_EID_VHT_CAPABILITY = 191, | ||
| 1474 | WLAN_EID_VHT_OPERATION = 192, | ||
| 1475 | |||
| 1476 | /* 802.11ad */ | ||
| 1477 | WLAN_EID_NON_TX_BSSID_CAP = 83, | ||
| 1478 | WLAN_EID_WAKEUP_SCHEDULE = 143, | ||
| 1479 | WLAN_EID_EXT_SCHEDULE = 144, | ||
| 1480 | WLAN_EID_STA_AVAILABILITY = 145, | ||
| 1481 | WLAN_EID_DMG_TSPEC = 146, | ||
| 1482 | WLAN_EID_DMG_AT = 147, | ||
| 1483 | WLAN_EID_DMG_CAP = 148, | ||
| 1484 | WLAN_EID_DMG_OPERATION = 151, | ||
| 1485 | WLAN_EID_DMG_BSS_PARAM_CHANGE = 152, | ||
| 1486 | WLAN_EID_DMG_BEAM_REFINEMENT = 153, | ||
| 1487 | WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154, | ||
| 1488 | WLAN_EID_AWAKE_WINDOW = 157, | ||
| 1489 | WLAN_EID_MULTI_BAND = 158, | ||
| 1490 | WLAN_EID_ADDBA_EXT = 159, | ||
| 1491 | WLAN_EID_NEXT_PCP_LIST = 160, | ||
| 1492 | WLAN_EID_PCP_HANDOVER = 161, | ||
| 1493 | WLAN_EID_DMG_LINK_MARGIN = 162, | ||
| 1494 | WLAN_EID_SWITCHING_STREAM = 163, | ||
| 1495 | WLAN_EID_SESSION_TRANSITION = 164, | ||
| 1496 | WLAN_EID_DYN_TONE_PAIRING_REPORT = 165, | ||
| 1497 | WLAN_EID_CLUSTER_REPORT = 166, | ||
| 1498 | WLAN_EID_RELAY_CAP = 167, | ||
| 1499 | WLAN_EID_RELAY_XFER_PARAM_SET = 168, | ||
| 1500 | WLAN_EID_BEAM_LINK_MAINT = 169, | ||
| 1501 | WLAN_EID_MULTIPLE_MAC_ADDR = 170, | ||
| 1502 | WLAN_EID_U_PID = 171, | ||
| 1503 | WLAN_EID_DMG_LINK_ADAPT_ACK = 172, | ||
| 1504 | WLAN_EID_QUIET_PERIOD_REQ = 175, | ||
| 1505 | WLAN_EID_QUIET_PERIOD_RESP = 177, | ||
| 1506 | WLAN_EID_EPAC_POLICY = 182, | ||
| 1507 | WLAN_EID_CLISTER_TIME_OFF = 183, | ||
| 1508 | WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190, | ||
| 1335 | }; | 1509 | }; |
| 1336 | 1510 | ||
| 1337 | /* Action category code */ | 1511 | /* Action category code */ |
| @@ -1348,7 +1522,10 @@ enum ieee80211_category { | |||
| 1348 | WLAN_CATEGORY_MESH_ACTION = 13, | 1522 | WLAN_CATEGORY_MESH_ACTION = 13, |
| 1349 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, | 1523 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, |
| 1350 | WLAN_CATEGORY_SELF_PROTECTED = 15, | 1524 | WLAN_CATEGORY_SELF_PROTECTED = 15, |
| 1525 | WLAN_CATEGORY_DMG = 16, | ||
| 1351 | WLAN_CATEGORY_WMM = 17, | 1526 | WLAN_CATEGORY_WMM = 17, |
| 1527 | WLAN_CATEGORY_FST = 18, | ||
| 1528 | WLAN_CATEGORY_UNPROT_DMG = 20, | ||
| 1352 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1529 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
| 1353 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1530 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
| 1354 | }; | 1531 | }; |
| @@ -1443,7 +1620,7 @@ enum ieee80211_tdls_actioncode { | |||
| 1443 | * | 1620 | * |
| 1444 | * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method | 1621 | * @IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET: the default synchronization method |
| 1445 | * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method | 1622 | * @IEEE80211_SYNC_METHOD_VENDOR: a vendor specific synchronization method |
| 1446 | * that will be specified in a vendor specific information element | 1623 | * that will be specified in a vendor specific information element |
| 1447 | */ | 1624 | */ |
| 1448 | enum { | 1625 | enum { |
| 1449 | IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1, | 1626 | IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET = 1, |
| @@ -1455,7 +1632,7 @@ enum { | |||
| 1455 | * | 1632 | * |
| 1456 | * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol | 1633 | * @IEEE80211_PATH_PROTOCOL_HWMP: the default path selection protocol |
| 1457 | * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will | 1634 | * @IEEE80211_PATH_PROTOCOL_VENDOR: a vendor specific protocol that will |
| 1458 | * be specified in a vendor specific information element | 1635 | * be specified in a vendor specific information element |
| 1459 | */ | 1636 | */ |
| 1460 | enum { | 1637 | enum { |
| 1461 | IEEE80211_PATH_PROTOCOL_HWMP = 1, | 1638 | IEEE80211_PATH_PROTOCOL_HWMP = 1, |
| @@ -1467,13 +1644,35 @@ enum { | |||
| 1467 | * | 1644 | * |
| 1468 | * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric | 1645 | * @IEEE80211_PATH_METRIC_AIRTIME: the default path selection metric |
| 1469 | * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be | 1646 | * @IEEE80211_PATH_METRIC_VENDOR: a vendor specific metric that will be |
| 1470 | * specified in a vendor specific information element | 1647 | * specified in a vendor specific information element |
| 1471 | */ | 1648 | */ |
| 1472 | enum { | 1649 | enum { |
| 1473 | IEEE80211_PATH_METRIC_AIRTIME = 1, | 1650 | IEEE80211_PATH_METRIC_AIRTIME = 1, |
| 1474 | IEEE80211_PATH_METRIC_VENDOR = 255, | 1651 | IEEE80211_PATH_METRIC_VENDOR = 255, |
| 1475 | }; | 1652 | }; |
| 1476 | 1653 | ||
| 1654 | /** | ||
| 1655 | * enum ieee80211_root_mode_identifier - root mesh STA mode identifier | ||
| 1656 | * | ||
| 1657 | * These attribute are used by dot11MeshHWMPRootMode to set root mesh STA mode | ||
| 1658 | * | ||
| 1659 | * @IEEE80211_ROOTMODE_NO_ROOT: the mesh STA is not a root mesh STA (default) | ||
| 1660 | * @IEEE80211_ROOTMODE_ROOT: the mesh STA is a root mesh STA if greater than | ||
| 1661 | * this value | ||
| 1662 | * @IEEE80211_PROACTIVE_PREQ_NO_PREP: the mesh STA is a root mesh STA supports | ||
| 1663 | * the proactive PREQ with proactive PREP subfield set to 0 | ||
| 1664 | * @IEEE80211_PROACTIVE_PREQ_WITH_PREP: the mesh STA is a root mesh STA | ||
| 1665 | * supports the proactive PREQ with proactive PREP subfield set to 1 | ||
| 1666 | * @IEEE80211_PROACTIVE_RANN: the mesh STA is a root mesh STA supports | ||
| 1667 | * the proactive RANN | ||
| 1668 | */ | ||
| 1669 | enum ieee80211_root_mode_identifier { | ||
| 1670 | IEEE80211_ROOTMODE_NO_ROOT = 0, | ||
| 1671 | IEEE80211_ROOTMODE_ROOT = 1, | ||
| 1672 | IEEE80211_PROACTIVE_PREQ_NO_PREP = 2, | ||
| 1673 | IEEE80211_PROACTIVE_PREQ_WITH_PREP = 3, | ||
| 1674 | IEEE80211_PROACTIVE_RANN = 4, | ||
| 1675 | }; | ||
| 1477 | 1676 | ||
| 1478 | /* | 1677 | /* |
| 1479 | * IEEE 802.11-2007 7.3.2.9 Country information element | 1678 | * IEEE 802.11-2007 7.3.2.9 Country information element |
| @@ -1574,6 +1773,7 @@ enum ieee80211_sa_query_action { | |||
| 1574 | #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 | 1773 | #define WLAN_CIPHER_SUITE_CCMP 0x000FAC04 |
| 1575 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 1774 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
| 1576 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 1775 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
| 1776 | #define WLAN_CIPHER_SUITE_GCMP 0x000FAC08 | ||
| 1577 | 1777 | ||
| 1578 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 | 1778 | #define WLAN_CIPHER_SUITE_SMS4 0x00147201 |
| 1579 | 1779 | ||
| @@ -1589,6 +1789,10 @@ enum ieee80211_sa_query_action { | |||
| 1589 | 1789 | ||
| 1590 | #define WLAN_OUI_WFA 0x506f9a | 1790 | #define WLAN_OUI_WFA 0x506f9a |
| 1591 | #define WLAN_OUI_TYPE_WFA_P2P 9 | 1791 | #define WLAN_OUI_TYPE_WFA_P2P 9 |
| 1792 | #define WLAN_OUI_MICROSOFT 0x0050f2 | ||
| 1793 | #define WLAN_OUI_TYPE_MICROSOFT_WPA 1 | ||
| 1794 | #define WLAN_OUI_TYPE_MICROSOFT_WMM 2 | ||
| 1795 | #define WLAN_OUI_TYPE_MICROSOFT_WPS 4 | ||
| 1592 | 1796 | ||
| 1593 | /* | 1797 | /* |
| 1594 | * WMM/802.11e Tspec Element | 1798 | * WMM/802.11e Tspec Element |
diff --git a/include/linux/if.h b/include/linux/if.h index f995c663c493..1ec407b01e46 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
| @@ -81,6 +81,8 @@ | |||
| 81 | #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ | 81 | #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ |
| 82 | #define IFF_TEAM_PORT 0x40000 /* device used as team port */ | 82 | #define IFF_TEAM_PORT 0x40000 /* device used as team port */ |
| 83 | #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ | 83 | #define IFF_SUPP_NOFCS 0x80000 /* device supports sending custom FCS */ |
| 84 | #define IFF_LIVE_ADDR_CHANGE 0x100000 /* device supports hardware address | ||
| 85 | * change when it's running */ | ||
| 84 | 86 | ||
| 85 | 87 | ||
| 86 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 88 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 56d907a2c804..167ce5b363d2 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -105,7 +105,8 @@ | |||
| 105 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ | 105 | #define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ |
| 106 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ | 106 | #define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ |
| 107 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ | 107 | #define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ |
| 108 | #define ETH_P_CAN 0x000C /* Controller Area Network */ | 108 | #define ETH_P_CAN 0x000C /* CAN: Controller Area Network */ |
| 109 | #define ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/ | ||
| 109 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ | 110 | #define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ |
| 110 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ | 111 | #define ETH_P_TR_802_2 0x0011 /* 802.2 frames */ |
| 111 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ | 112 | #define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index f715750d0b87..ac173bd2ab65 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
| @@ -140,6 +140,8 @@ enum { | |||
| 140 | IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ | 140 | IFLA_EXT_MASK, /* Extended info mask, VFs, etc */ |
| 141 | IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */ | 141 | IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */ |
| 142 | #define IFLA_PROMISCUITY IFLA_PROMISCUITY | 142 | #define IFLA_PROMISCUITY IFLA_PROMISCUITY |
| 143 | IFLA_NUM_TX_QUEUES, | ||
| 144 | IFLA_NUM_RX_QUEUES, | ||
| 143 | __IFLA_MAX | 145 | __IFLA_MAX |
| 144 | }; | 146 | }; |
| 145 | 147 | ||
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 8185f57a9c7f..6960fc1841a7 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
| @@ -13,6 +13,9 @@ | |||
| 13 | 13 | ||
| 14 | #ifdef __KERNEL__ | 14 | #ifdef __KERNEL__ |
| 15 | 15 | ||
| 16 | #include <linux/netpoll.h> | ||
| 17 | #include <net/sch_generic.h> | ||
| 18 | |||
| 16 | struct team_pcpu_stats { | 19 | struct team_pcpu_stats { |
| 17 | u64 rx_packets; | 20 | u64 rx_packets; |
| 18 | u64 rx_bytes; | 21 | u64 rx_bytes; |
| @@ -60,9 +63,54 @@ struct team_port { | |||
| 60 | unsigned int mtu; | 63 | unsigned int mtu; |
| 61 | } orig; | 64 | } orig; |
| 62 | 65 | ||
| 63 | struct rcu_head rcu; | 66 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 67 | struct netpoll *np; | ||
| 68 | #endif | ||
| 69 | |||
| 70 | long mode_priv[0]; | ||
| 64 | }; | 71 | }; |
| 65 | 72 | ||
| 73 | static inline bool team_port_enabled(struct team_port *port) | ||
| 74 | { | ||
| 75 | return port->index != -1; | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline bool team_port_txable(struct team_port *port) | ||
| 79 | { | ||
| 80 | return port->linkup && team_port_enabled(port); | ||
| 81 | } | ||
| 82 | |||
| 83 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
| 84 | static inline void team_netpoll_send_skb(struct team_port *port, | ||
| 85 | struct sk_buff *skb) | ||
| 86 | { | ||
| 87 | struct netpoll *np = port->np; | ||
| 88 | |||
| 89 | if (np) | ||
| 90 | netpoll_send_skb(np, skb); | ||
| 91 | } | ||
| 92 | #else | ||
| 93 | static inline void team_netpoll_send_skb(struct team_port *port, | ||
| 94 | struct sk_buff *skb) | ||
| 95 | { | ||
| 96 | } | ||
| 97 | #endif | ||
| 98 | |||
| 99 | static inline int team_dev_queue_xmit(struct team *team, struct team_port *port, | ||
| 100 | struct sk_buff *skb) | ||
| 101 | { | ||
| 102 | BUILD_BUG_ON(sizeof(skb->queue_mapping) != | ||
| 103 | sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping)); | ||
| 104 | skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping); | ||
| 105 | |||
| 106 | skb->dev = port->dev; | ||
| 107 | if (unlikely(netpoll_tx_running(port->dev))) { | ||
| 108 | team_netpoll_send_skb(port, skb); | ||
| 109 | return 0; | ||
| 110 | } | ||
| 111 | return dev_queue_xmit(skb); | ||
| 112 | } | ||
| 113 | |||
| 66 | struct team_mode_ops { | 114 | struct team_mode_ops { |
| 67 | int (*init)(struct team *team); | 115 | int (*init)(struct team *team); |
| 68 | void (*exit)(struct team *team); | 116 | void (*exit)(struct team *team); |
| @@ -73,6 +121,8 @@ struct team_mode_ops { | |||
| 73 | int (*port_enter)(struct team *team, struct team_port *port); | 121 | int (*port_enter)(struct team *team, struct team_port *port); |
| 74 | void (*port_leave)(struct team *team, struct team_port *port); | 122 | void (*port_leave)(struct team *team, struct team_port *port); |
| 75 | void (*port_change_mac)(struct team *team, struct team_port *port); | 123 | void (*port_change_mac)(struct team *team, struct team_port *port); |
| 124 | void (*port_enabled)(struct team *team, struct team_port *port); | ||
| 125 | void (*port_disabled)(struct team *team, struct team_port *port); | ||
| 76 | }; | 126 | }; |
| 77 | 127 | ||
| 78 | enum team_option_type { | 128 | enum team_option_type { |
| @@ -82,6 +132,11 @@ enum team_option_type { | |||
| 82 | TEAM_OPTION_TYPE_BOOL, | 132 | TEAM_OPTION_TYPE_BOOL, |
| 83 | }; | 133 | }; |
| 84 | 134 | ||
| 135 | struct team_option_inst_info { | ||
| 136 | u32 array_index; | ||
| 137 | struct team_port *port; /* != NULL if per-port */ | ||
| 138 | }; | ||
| 139 | |||
| 85 | struct team_gsetter_ctx { | 140 | struct team_gsetter_ctx { |
| 86 | union { | 141 | union { |
| 87 | u32 u32_val; | 142 | u32 u32_val; |
| @@ -92,23 +147,28 @@ struct team_gsetter_ctx { | |||
| 92 | } bin_val; | 147 | } bin_val; |
| 93 | bool bool_val; | 148 | bool bool_val; |
| 94 | } data; | 149 | } data; |
| 95 | struct team_port *port; | 150 | struct team_option_inst_info *info; |
| 96 | }; | 151 | }; |
| 97 | 152 | ||
| 98 | struct team_option { | 153 | struct team_option { |
| 99 | struct list_head list; | 154 | struct list_head list; |
| 100 | const char *name; | 155 | const char *name; |
| 101 | bool per_port; | 156 | bool per_port; |
| 157 | unsigned int array_size; /* != 0 means the option is array */ | ||
| 102 | enum team_option_type type; | 158 | enum team_option_type type; |
| 159 | int (*init)(struct team *team, struct team_option_inst_info *info); | ||
| 103 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); | 160 | int (*getter)(struct team *team, struct team_gsetter_ctx *ctx); |
| 104 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); | 161 | int (*setter)(struct team *team, struct team_gsetter_ctx *ctx); |
| 105 | }; | 162 | }; |
| 106 | 163 | ||
| 164 | extern void team_option_inst_set_change(struct team_option_inst_info *opt_inst_info); | ||
| 165 | extern void team_options_change_check(struct team *team); | ||
| 166 | |||
| 107 | struct team_mode { | 167 | struct team_mode { |
| 108 | struct list_head list; | ||
| 109 | const char *kind; | 168 | const char *kind; |
| 110 | struct module *owner; | 169 | struct module *owner; |
| 111 | size_t priv_size; | 170 | size_t priv_size; |
| 171 | size_t port_priv_size; | ||
| 112 | const struct team_mode_ops *ops; | 172 | const struct team_mode_ops *ops; |
| 113 | }; | 173 | }; |
| 114 | 174 | ||
| @@ -178,8 +238,11 @@ extern int team_options_register(struct team *team, | |||
| 178 | extern void team_options_unregister(struct team *team, | 238 | extern void team_options_unregister(struct team *team, |
| 179 | const struct team_option *option, | 239 | const struct team_option *option, |
| 180 | size_t option_count); | 240 | size_t option_count); |
| 181 | extern int team_mode_register(struct team_mode *mode); | 241 | extern int team_mode_register(const struct team_mode *mode); |
| 182 | extern int team_mode_unregister(struct team_mode *mode); | 242 | extern void team_mode_unregister(const struct team_mode *mode); |
| 243 | |||
| 244 | #define TEAM_DEFAULT_NUM_TX_QUEUES 16 | ||
| 245 | #define TEAM_DEFAULT_NUM_RX_QUEUES 16 | ||
| 183 | 246 | ||
| 184 | #endif /* __KERNEL__ */ | 247 | #endif /* __KERNEL__ */ |
| 185 | 248 | ||
| @@ -241,6 +304,7 @@ enum { | |||
| 241 | TEAM_ATTR_OPTION_DATA, /* dynamic */ | 304 | TEAM_ATTR_OPTION_DATA, /* dynamic */ |
| 242 | TEAM_ATTR_OPTION_REMOVED, /* flag */ | 305 | TEAM_ATTR_OPTION_REMOVED, /* flag */ |
| 243 | TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ | 306 | TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */ |
| 307 | TEAM_ATTR_OPTION_ARRAY_INDEX, /* u32 */ /* for array options */ | ||
| 244 | 308 | ||
| 245 | __TEAM_ATTR_OPTION_MAX, | 309 | __TEAM_ATTR_OPTION_MAX, |
| 246 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, | 310 | TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1, |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 16b92d008bed..5efff60b6f56 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
| @@ -80,4 +80,18 @@ enum { | |||
| 80 | 80 | ||
| 81 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) | 81 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) |
| 82 | 82 | ||
| 83 | /* VTI-mode i_flags */ | ||
| 84 | #define VTI_ISVTI 0x0001 | ||
| 85 | |||
| 86 | enum { | ||
| 87 | IFLA_VTI_UNSPEC, | ||
| 88 | IFLA_VTI_LINK, | ||
| 89 | IFLA_VTI_IKEY, | ||
| 90 | IFLA_VTI_OKEY, | ||
| 91 | IFLA_VTI_LOCAL, | ||
| 92 | IFLA_VTI_REMOTE, | ||
| 93 | __IFLA_VTI_MAX, | ||
| 94 | }; | ||
| 95 | |||
| 96 | #define IFLA_VTI_MAX (__IFLA_VTI_MAX - 1) | ||
| 83 | #endif /* _IF_TUNNEL_H_ */ | 97 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 597f4a9f3240..67f9ddacb70c 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -38,6 +38,7 @@ enum | |||
| 38 | IPV4_DEVCONF_ACCEPT_LOCAL, | 38 | IPV4_DEVCONF_ACCEPT_LOCAL, |
| 39 | IPV4_DEVCONF_SRC_VMARK, | 39 | IPV4_DEVCONF_SRC_VMARK, |
| 40 | IPV4_DEVCONF_PROXY_ARP_PVLAN, | 40 | IPV4_DEVCONF_PROXY_ARP_PVLAN, |
| 41 | IPV4_DEVCONF_ROUTE_LOCALNET, | ||
| 41 | __IPV4_DEVCONF_MAX | 42 | __IPV4_DEVCONF_MAX |
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| @@ -131,6 +132,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
| 131 | #define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ | 132 | #define IN_DEV_PROMOTE_SECONDARIES(in_dev) \ |
| 132 | IN_DEV_ORCONF((in_dev), \ | 133 | IN_DEV_ORCONF((in_dev), \ |
| 133 | PROMOTE_SECONDARIES) | 134 | PROMOTE_SECONDARIES) |
| 135 | #define IN_DEV_ROUTE_LOCALNET(in_dev) IN_DEV_ORCONF(in_dev, ROUTE_LOCALNET) | ||
| 134 | 136 | ||
| 135 | #define IN_DEV_RX_REDIRECTS(in_dev) \ | 137 | #define IN_DEV_RX_REDIRECTS(in_dev) \ |
| 136 | ((IN_DEV_FORWARD(in_dev) && \ | 138 | ((IN_DEV_FORWARD(in_dev) && \ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 8260ef779762..379e433e15e0 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -299,9 +299,9 @@ struct ipv6_pinfo { | |||
| 299 | struct in6_addr rcv_saddr; | 299 | struct in6_addr rcv_saddr; |
| 300 | struct in6_addr daddr; | 300 | struct in6_addr daddr; |
| 301 | struct in6_pktinfo sticky_pktinfo; | 301 | struct in6_pktinfo sticky_pktinfo; |
| 302 | struct in6_addr *daddr_cache; | 302 | const struct in6_addr *daddr_cache; |
| 303 | #ifdef CONFIG_IPV6_SUBTREES | 303 | #ifdef CONFIG_IPV6_SUBTREES |
| 304 | struct in6_addr *saddr_cache; | 304 | const struct in6_addr *saddr_cache; |
| 305 | #endif | 305 | #endif |
| 306 | 306 | ||
| 307 | __be32 flow_label; | 307 | __be32 flow_label; |
| @@ -410,6 +410,22 @@ struct tcp6_sock { | |||
| 410 | 410 | ||
| 411 | extern int inet6_sk_rebuild_header(struct sock *sk); | 411 | extern int inet6_sk_rebuild_header(struct sock *sk); |
| 412 | 412 | ||
| 413 | struct inet6_timewait_sock { | ||
| 414 | struct in6_addr tw_v6_daddr; | ||
| 415 | struct in6_addr tw_v6_rcv_saddr; | ||
| 416 | }; | ||
| 417 | |||
| 418 | struct tcp6_timewait_sock { | ||
| 419 | struct tcp_timewait_sock tcp6tw_tcp; | ||
| 420 | struct inet6_timewait_sock tcp6tw_inet6; | ||
| 421 | }; | ||
| 422 | |||
| 423 | static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk) | ||
| 424 | { | ||
| 425 | return (struct inet6_timewait_sock *)(((u8 *)sk) + | ||
| 426 | inet_twsk(sk)->tw_ipv6_offset); | ||
| 427 | } | ||
| 428 | |||
| 413 | #if IS_ENABLED(CONFIG_IPV6) | 429 | #if IS_ENABLED(CONFIG_IPV6) |
| 414 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) | 430 | static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) |
| 415 | { | 431 | { |
| @@ -459,28 +475,12 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
| 459 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) | 475 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) |
| 460 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) | 476 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) |
| 461 | 477 | ||
| 462 | struct inet6_timewait_sock { | ||
| 463 | struct in6_addr tw_v6_daddr; | ||
| 464 | struct in6_addr tw_v6_rcv_saddr; | ||
| 465 | }; | ||
| 466 | |||
| 467 | struct tcp6_timewait_sock { | ||
| 468 | struct tcp_timewait_sock tcp6tw_tcp; | ||
| 469 | struct inet6_timewait_sock tcp6tw_inet6; | ||
| 470 | }; | ||
| 471 | |||
| 472 | static inline u16 inet6_tw_offset(const struct proto *prot) | 478 | static inline u16 inet6_tw_offset(const struct proto *prot) |
| 473 | { | 479 | { |
| 474 | return prot->twsk_prot->twsk_obj_size - | 480 | return prot->twsk_prot->twsk_obj_size - |
| 475 | sizeof(struct inet6_timewait_sock); | 481 | sizeof(struct inet6_timewait_sock); |
| 476 | } | 482 | } |
| 477 | 483 | ||
| 478 | static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk) | ||
| 479 | { | ||
| 480 | return (struct inet6_timewait_sock *)(((u8 *)sk) + | ||
| 481 | inet_twsk(sk)->tw_ipv6_offset); | ||
| 482 | } | ||
| 483 | |||
| 484 | static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) | 484 | static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk) |
| 485 | { | 485 | { |
| 486 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 486 | return likely(sk->sk_state != TCP_TIME_WAIT) ? |
diff --git a/include/linux/ks8851_mll.h b/include/linux/ks8851_mll.h new file mode 100644 index 000000000000..e9ccfb59ed30 --- /dev/null +++ b/include/linux/ks8851_mll.h | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | /* | ||
| 2 | * ks8861_mll platform data struct definition | ||
| 3 | * Copyright (c) 2012 BTicino S.p.A. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef _LINUX_KS8851_MLL_H | ||
| 20 | #define _LINUX_KS8851_MLL_H | ||
| 21 | |||
| 22 | #include <linux/if_ether.h> | ||
| 23 | |||
| 24 | /** | ||
| 25 | * struct ks8851_mll_platform_data - Platform data of the KS8851_MLL network driver | ||
| 26 | * @macaddr: The MAC address of the device, set to all 0:s to use the on in | ||
| 27 | * the chip. | ||
| 28 | */ | ||
| 29 | struct ks8851_mll_platform_data { | ||
| 30 | u8 mac_addr[ETH_ALEN]; | ||
| 31 | }; | ||
| 32 | |||
| 33 | #endif | ||
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 09f2b3aa2da7..2ce09aa7d3b3 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -617,6 +617,7 @@ struct kvm_ppc_smmu_info { | |||
| 617 | #define KVM_CAP_SIGNAL_MSI 77 | 617 | #define KVM_CAP_SIGNAL_MSI 77 |
| 618 | #define KVM_CAP_PPC_GET_SMMU_INFO 78 | 618 | #define KVM_CAP_PPC_GET_SMMU_INFO 78 |
| 619 | #define KVM_CAP_S390_COW 79 | 619 | #define KVM_CAP_S390_COW 79 |
| 620 | #define KVM_CAP_PPC_ALLOC_HTAB 80 | ||
| 620 | 621 | ||
| 621 | #ifdef KVM_CAP_IRQ_ROUTING | 622 | #ifdef KVM_CAP_IRQ_ROUTING |
| 622 | 623 | ||
| @@ -828,6 +829,8 @@ struct kvm_s390_ucas_mapping { | |||
| 828 | #define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) | 829 | #define KVM_SIGNAL_MSI _IOW(KVMIO, 0xa5, struct kvm_msi) |
| 829 | /* Available with KVM_CAP_PPC_GET_SMMU_INFO */ | 830 | /* Available with KVM_CAP_PPC_GET_SMMU_INFO */ |
| 830 | #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) | 831 | #define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) |
| 832 | /* Available with KVM_CAP_PPC_ALLOC_HTAB */ | ||
| 833 | #define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) | ||
| 831 | 834 | ||
| 832 | /* | 835 | /* |
| 833 | * ioctls for vcpu fds | 836 | * ioctls for vcpu fds |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 96c158a37d3e..b70b48b01098 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -306,7 +306,7 @@ struct kvm { | |||
| 306 | struct hlist_head irq_ack_notifier_list; | 306 | struct hlist_head irq_ack_notifier_list; |
| 307 | #endif | 307 | #endif |
| 308 | 308 | ||
| 309 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | 309 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) |
| 310 | struct mmu_notifier mmu_notifier; | 310 | struct mmu_notifier mmu_notifier; |
| 311 | unsigned long mmu_notifier_seq; | 311 | unsigned long mmu_notifier_seq; |
| 312 | long mmu_notifier_count; | 312 | long mmu_notifier_count; |
| @@ -314,13 +314,19 @@ struct kvm { | |||
| 314 | long tlbs_dirty; | 314 | long tlbs_dirty; |
| 315 | }; | 315 | }; |
| 316 | 316 | ||
| 317 | /* The guest did something we don't support. */ | 317 | #define kvm_err(fmt, ...) \ |
| 318 | #define pr_unimpl(vcpu, fmt, ...) \ | 318 | pr_err("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__) |
| 319 | pr_err_ratelimited("kvm: %i: cpu%i " fmt, \ | 319 | #define kvm_info(fmt, ...) \ |
| 320 | current->tgid, (vcpu)->vcpu_id , ## __VA_ARGS__) | 320 | pr_info("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__) |
| 321 | #define kvm_debug(fmt, ...) \ | ||
| 322 | pr_debug("kvm [%i]: " fmt, task_pid_nr(current), ## __VA_ARGS__) | ||
| 323 | #define kvm_pr_unimpl(fmt, ...) \ | ||
| 324 | pr_err_ratelimited("kvm [%i]: " fmt, \ | ||
| 325 | task_tgid_nr(current), ## __VA_ARGS__) | ||
| 321 | 326 | ||
| 322 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) | 327 | /* The guest did something we don't support. */ |
| 323 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) | 328 | #define vcpu_unimpl(vcpu, fmt, ...) \ |
| 329 | kvm_pr_unimpl("vcpu%i " fmt, (vcpu)->vcpu_id, ## __VA_ARGS__) | ||
| 324 | 330 | ||
| 325 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | 331 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) |
| 326 | { | 332 | { |
| @@ -535,6 +541,9 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); | |||
| 535 | 541 | ||
| 536 | void kvm_free_physmem(struct kvm *kvm); | 542 | void kvm_free_physmem(struct kvm *kvm); |
| 537 | 543 | ||
| 544 | void *kvm_kvzalloc(unsigned long size); | ||
| 545 | void kvm_kvfree(const void *addr); | ||
| 546 | |||
| 538 | #ifndef __KVM_HAVE_ARCH_VM_ALLOC | 547 | #ifndef __KVM_HAVE_ARCH_VM_ALLOC |
| 539 | static inline struct kvm *kvm_arch_alloc_vm(void) | 548 | static inline struct kvm *kvm_arch_alloc_vm(void) |
| 540 | { | 549 | { |
| @@ -771,7 +780,7 @@ struct kvm_stats_debugfs_item { | |||
| 771 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 780 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
| 772 | extern struct dentry *kvm_debugfs_dir; | 781 | extern struct dentry *kvm_debugfs_dir; |
| 773 | 782 | ||
| 774 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | 783 | #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) |
| 775 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) | 784 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) |
| 776 | { | 785 | { |
| 777 | if (unlikely(vcpu->kvm->mmu_notifier_count)) | 786 | if (unlikely(vcpu->kvm->mmu_notifier_count)) |
| @@ -793,7 +802,7 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se | |||
| 793 | } | 802 | } |
| 794 | #endif | 803 | #endif |
| 795 | 804 | ||
| 796 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 805 | #ifdef KVM_CAP_IRQ_ROUTING |
| 797 | 806 | ||
| 798 | #define KVM_MAX_IRQ_ROUTES 1024 | 807 | #define KVM_MAX_IRQ_ROUTES 1024 |
| 799 | 808 | ||
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index dfb947959ec9..7cccafe50e7b 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
| @@ -43,7 +43,11 @@ | |||
| 43 | #define MDIO_PKGID2 15 | 43 | #define MDIO_PKGID2 15 |
| 44 | #define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ | 44 | #define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ |
| 45 | #define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ | 45 | #define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ |
| 46 | #define MDIO_PCS_EEE_ABLE 20 /* EEE Capability register */ | ||
| 47 | #define MDIO_PCS_EEE_WK_ERR 22 /* EEE wake error counter */ | ||
| 46 | #define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ | 48 | #define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ |
| 49 | #define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ | ||
| 50 | #define MDIO_AN_EEE_LPABLE 61 /* EEE link partner ability */ | ||
| 47 | 51 | ||
| 48 | /* Media-dependent registers. */ | 52 | /* Media-dependent registers. */ |
| 49 | #define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ | 53 | #define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ |
| @@ -56,7 +60,6 @@ | |||
| 56 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ | 60 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ |
| 57 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ | 61 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ |
| 58 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ | 62 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ |
| 59 | #define MDIO_AN_EEE_ADV 60 /* EEE advertisement */ | ||
| 60 | 63 | ||
| 61 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ | 64 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ |
| 62 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ | 65 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ |
| @@ -82,6 +85,7 @@ | |||
| 82 | #define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART | 85 | #define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART |
| 83 | #define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE | 86 | #define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE |
| 84 | #define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ | 87 | #define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ |
| 88 | #define MDIO_PCS_CTRL1_CLKSTOP_EN 0x400 /* Stop the clock during LPI */ | ||
| 85 | 89 | ||
| 86 | /* 10 Gb/s */ | 90 | /* 10 Gb/s */ |
| 87 | #define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) | 91 | #define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) |
| @@ -237,9 +241,25 @@ | |||
| 237 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ | 241 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ |
| 238 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ | 242 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ |
| 239 | 243 | ||
| 240 | /* AN EEE Advertisement register. */ | 244 | /* EEE Supported/Advertisement/LP Advertisement registers. |
| 241 | #define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ | 245 | * |
| 242 | #define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ | 246 | * EEE capability Register (3.20), Advertisement (7.60) and |
| 247 | * Link partner ability (7.61) registers have and can use the same identical | ||
| 248 | * bit masks. | ||
| 249 | */ | ||
| 250 | #define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */ | ||
| 251 | #define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */ | ||
| 252 | /* Note: the two defines above can be potentially used by the user-land | ||
| 253 | * and cannot remove them now. | ||
| 254 | * So, we define the new generic MDIO_EEE_100TX and MDIO_EEE_1000T macros | ||
| 255 | * using the previous ones (that can be considered obsolete). | ||
| 256 | */ | ||
| 257 | #define MDIO_EEE_100TX MDIO_AN_EEE_ADV_100TX /* 100TX EEE cap */ | ||
| 258 | #define MDIO_EEE_1000T MDIO_AN_EEE_ADV_1000T /* 1000T EEE cap */ | ||
| 259 | #define MDIO_EEE_10GT 0x0008 /* 10GT EEE cap */ | ||
| 260 | #define MDIO_EEE_1000KX 0x0010 /* 1000KX EEE cap */ | ||
| 261 | #define MDIO_EEE_10GKX4 0x0020 /* 10G KX4 EEE cap */ | ||
| 262 | #define MDIO_EEE_10GKR 0x0040 /* 10G KR EEE cap */ | ||
| 243 | 263 | ||
| 244 | /* LASI RX_ALARM control/status registers. */ | 264 | /* LASI RX_ALARM control/status registers. */ |
| 245 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ | 265 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ |
diff --git a/include/linux/mfd/abx500/ab8500-codec.h b/include/linux/mfd/abx500/ab8500-codec.h new file mode 100644 index 000000000000..dc6529202cdd --- /dev/null +++ b/include/linux/mfd/abx500/ab8500-codec.h | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) ST-Ericsson SA 2012 | ||
| 3 | * | ||
| 4 | * Author: Ola Lilja <ola.o.lilja@stericsson.com> | ||
| 5 | * for ST-Ericsson. | ||
| 6 | * | ||
| 7 | * License terms: | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify it | ||
| 10 | * under the terms of the GNU General Public License version 2 as published | ||
| 11 | * by the Free Software Foundation. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef AB8500_CORE_CODEC_H | ||
| 15 | #define AB8500_CORE_CODEC_H | ||
| 16 | |||
| 17 | /* Mic-types */ | ||
| 18 | enum amic_type { | ||
| 19 | AMIC_TYPE_SINGLE_ENDED, | ||
| 20 | AMIC_TYPE_DIFFERENTIAL | ||
| 21 | }; | ||
| 22 | |||
| 23 | /* Mic-biases */ | ||
| 24 | enum amic_micbias { | ||
| 25 | AMIC_MICBIAS_VAMIC1, | ||
| 26 | AMIC_MICBIAS_VAMIC2 | ||
| 27 | }; | ||
| 28 | |||
| 29 | /* Bias-voltage */ | ||
| 30 | enum ear_cm_voltage { | ||
| 31 | EAR_CMV_0_95V, | ||
| 32 | EAR_CMV_1_10V, | ||
| 33 | EAR_CMV_1_27V, | ||
| 34 | EAR_CMV_1_58V | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* Analog microphone settings */ | ||
| 38 | struct amic_settings { | ||
| 39 | enum amic_type mic1_type; | ||
| 40 | enum amic_type mic2_type; | ||
| 41 | enum amic_micbias mic1a_micbias; | ||
| 42 | enum amic_micbias mic1b_micbias; | ||
| 43 | enum amic_micbias mic2_micbias; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* Platform data structure for the audio-parts of the AB8500 */ | ||
| 47 | struct ab8500_codec_platform_data { | ||
| 48 | struct amic_settings amics; | ||
| 49 | enum ear_cm_voltage ear_cmv; | ||
| 50 | }; | ||
| 51 | |||
| 52 | #endif | ||
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 91dd3ef63e99..bc9b84b60ec6 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h | |||
| @@ -266,6 +266,7 @@ struct ab8500 { | |||
| 266 | struct regulator_reg_init; | 266 | struct regulator_reg_init; |
| 267 | struct regulator_init_data; | 267 | struct regulator_init_data; |
| 268 | struct ab8500_gpio_platform_data; | 268 | struct ab8500_gpio_platform_data; |
| 269 | struct ab8500_codec_platform_data; | ||
| 269 | 270 | ||
| 270 | /** | 271 | /** |
| 271 | * struct ab8500_platform_data - AB8500 platform data | 272 | * struct ab8500_platform_data - AB8500 platform data |
| @@ -284,6 +285,7 @@ struct ab8500_platform_data { | |||
| 284 | int num_regulator; | 285 | int num_regulator; |
| 285 | struct regulator_init_data *regulator; | 286 | struct regulator_init_data *regulator; |
| 286 | struct ab8500_gpio_platform_data *gpio; | 287 | struct ab8500_gpio_platform_data *gpio; |
| 288 | struct ab8500_codec_platform_data *codec; | ||
| 287 | }; | 289 | }; |
| 288 | 290 | ||
| 289 | extern int __devinit ab8500_init(struct ab8500 *ab8500, | 291 | extern int __devinit ab8500_init(struct ab8500 *ab8500, |
diff --git a/include/linux/mii.h b/include/linux/mii.h index 2783eca629a0..8ef3a7a11592 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | #define MII_EXPANSION 0x06 /* Expansion register */ | 21 | #define MII_EXPANSION 0x06 /* Expansion register */ |
| 22 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ | 22 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ |
| 23 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ | 23 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ |
| 24 | #define MII_MMD_CTRL 0x0d /* MMD Access Control Register */ | ||
| 25 | #define MII_MMD_DATA 0x0e /* MMD Access Data Register */ | ||
| 24 | #define MII_ESTATUS 0x0f /* Extended Status */ | 26 | #define MII_ESTATUS 0x0f /* Extended Status */ |
| 25 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ | 27 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ |
| 26 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ | 28 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ |
| @@ -141,6 +143,13 @@ | |||
| 141 | #define FLOW_CTRL_TX 0x01 | 143 | #define FLOW_CTRL_TX 0x01 |
| 142 | #define FLOW_CTRL_RX 0x02 | 144 | #define FLOW_CTRL_RX 0x02 |
| 143 | 145 | ||
| 146 | /* MMD Access Control register fields */ | ||
| 147 | #define MII_MMD_CTRL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/ | ||
| 148 | #define MII_MMD_CTRL_ADDR 0x0000 /* Address */ | ||
| 149 | #define MII_MMD_CTRL_NOINCR 0x4000 /* no post increment */ | ||
| 150 | #define MII_MMD_CTRL_INCR_RDWT 0x8000 /* post increment on reads & writes */ | ||
| 151 | #define MII_MMD_CTRL_INCR_ON_WT 0xC000 /* post increment on writes only */ | ||
| 152 | |||
| 144 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ | 153 | /* This structure is used in all SIOCxMIIxxx ioctl calls */ |
| 145 | struct mii_ioctl_data { | 154 | struct mii_ioctl_data { |
| 146 | __u16 phy_id; | 155 | __u16 phy_id; |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 0549d2115507..e0deeb2cc939 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #define MPT_MINOR 220 | 35 | #define MPT_MINOR 220 |
| 36 | #define MPT2SAS_MINOR 221 | 36 | #define MPT2SAS_MINOR 221 |
| 37 | #define UINPUT_MINOR 223 | 37 | #define UINPUT_MINOR 223 |
| 38 | #define MISC_MCELOG_MINOR 227 | ||
| 38 | #define HPET_MINOR 228 | 39 | #define HPET_MINOR 228 |
| 39 | #define FUSE_MINOR 229 | 40 | #define FUSE_MINOR 229 |
| 40 | #define KVM_MINOR 232 | 41 | #define KVM_MINOR 232 |
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h index 1f3860a8a109..260695186256 100644 --- a/include/linux/mlx4/cmd.h +++ b/include/linux/mlx4/cmd.h | |||
| @@ -154,6 +154,10 @@ enum { | |||
| 154 | /* set port opcode modifiers */ | 154 | /* set port opcode modifiers */ |
| 155 | MLX4_SET_PORT_PRIO2TC = 0x8, | 155 | MLX4_SET_PORT_PRIO2TC = 0x8, |
| 156 | MLX4_SET_PORT_SCHEDULER = 0x9, | 156 | MLX4_SET_PORT_SCHEDULER = 0x9, |
| 157 | |||
| 158 | /* register/delete flow steering network rules */ | ||
| 159 | MLX4_QP_FLOW_STEERING_ATTACH = 0x65, | ||
| 160 | MLX4_QP_FLOW_STEERING_DETACH = 0x66, | ||
| 157 | }; | 161 | }; |
| 158 | 162 | ||
| 159 | enum { | 163 | enum { |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 6a8f002b8ed3..4d7761f8c3f6 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
| 37 | #include <linux/completion.h> | 37 | #include <linux/completion.h> |
| 38 | #include <linux/radix-tree.h> | 38 | #include <linux/radix-tree.h> |
| 39 | #include <linux/cpu_rmap.h> | ||
| 39 | 40 | ||
| 40 | #include <linux/atomic.h> | 41 | #include <linux/atomic.h> |
| 41 | 42 | ||
| @@ -70,6 +71,36 @@ enum { | |||
| 70 | MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) | 71 | MLX4_MFUNC_EQE_MASK = (MLX4_MFUNC_MAX_EQES - 1) |
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | /* Driver supports 3 diffrent device methods to manage traffic steering: | ||
| 75 | * -device managed - High level API for ib and eth flow steering. FW is | ||
| 76 | * managing flow steering tables. | ||
| 77 | * - B0 steering mode - Common low level API for ib and (if supported) eth. | ||
| 78 | * - A0 steering mode - Limited low level API for eth. In case of IB, | ||
| 79 | * B0 mode is in use. | ||
| 80 | */ | ||
| 81 | enum { | ||
| 82 | MLX4_STEERING_MODE_A0, | ||
| 83 | MLX4_STEERING_MODE_B0, | ||
| 84 | MLX4_STEERING_MODE_DEVICE_MANAGED | ||
| 85 | }; | ||
| 86 | |||
| 87 | static inline const char *mlx4_steering_mode_str(int steering_mode) | ||
| 88 | { | ||
| 89 | switch (steering_mode) { | ||
| 90 | case MLX4_STEERING_MODE_A0: | ||
| 91 | return "A0 steering"; | ||
| 92 | |||
| 93 | case MLX4_STEERING_MODE_B0: | ||
| 94 | return "B0 steering"; | ||
| 95 | |||
| 96 | case MLX4_STEERING_MODE_DEVICE_MANAGED: | ||
| 97 | return "Device managed flow steering"; | ||
| 98 | |||
| 99 | default: | ||
| 100 | return "Unrecognize steering mode"; | ||
| 101 | } | ||
| 102 | } | ||
| 103 | |||
| 73 | enum { | 104 | enum { |
| 74 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, | 105 | MLX4_DEV_CAP_FLAG_RC = 1LL << 0, |
| 75 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, | 106 | MLX4_DEV_CAP_FLAG_UC = 1LL << 1, |
| @@ -102,7 +133,8 @@ enum { | |||
| 102 | enum { | 133 | enum { |
| 103 | MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, | 134 | MLX4_DEV_CAP_FLAG2_RSS = 1LL << 0, |
| 104 | MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, | 135 | MLX4_DEV_CAP_FLAG2_RSS_TOP = 1LL << 1, |
| 105 | MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2 | 136 | MLX4_DEV_CAP_FLAG2_RSS_XOR = 1LL << 2, |
| 137 | MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3 | ||
| 106 | }; | 138 | }; |
| 107 | 139 | ||
| 108 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) | 140 | #define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) |
| @@ -295,6 +327,8 @@ struct mlx4_caps { | |||
| 295 | int num_amgms; | 327 | int num_amgms; |
| 296 | int reserved_mcgs; | 328 | int reserved_mcgs; |
| 297 | int num_qp_per_mgm; | 329 | int num_qp_per_mgm; |
| 330 | int steering_mode; | ||
| 331 | int fs_log_max_ucast_qp_range_size; | ||
| 298 | int num_pds; | 332 | int num_pds; |
| 299 | int reserved_pds; | 333 | int reserved_pds; |
| 300 | int max_xrcds; | 334 | int max_xrcds; |
| @@ -509,6 +543,8 @@ struct mlx4_dev { | |||
| 509 | u8 rev_id; | 543 | u8 rev_id; |
| 510 | char board_id[MLX4_BOARD_ID_LEN]; | 544 | char board_id[MLX4_BOARD_ID_LEN]; |
| 511 | int num_vfs; | 545 | int num_vfs; |
| 546 | u64 regid_promisc_array[MLX4_MAX_PORTS + 1]; | ||
| 547 | u64 regid_allmulti_array[MLX4_MAX_PORTS + 1]; | ||
| 512 | }; | 548 | }; |
| 513 | 549 | ||
| 514 | struct mlx4_init_port_param { | 550 | struct mlx4_init_port_param { |
| @@ -623,9 +659,99 @@ int mlx4_unicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
| 623 | int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | 659 | int mlx4_unicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
| 624 | enum mlx4_protocol prot); | 660 | enum mlx4_protocol prot); |
| 625 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | 661 | int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
| 626 | int block_mcast_loopback, enum mlx4_protocol protocol); | 662 | u8 port, int block_mcast_loopback, |
| 663 | enum mlx4_protocol protocol, u64 *reg_id); | ||
| 627 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | 664 | int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], |
| 628 | enum mlx4_protocol protocol); | 665 | enum mlx4_protocol protocol, u64 reg_id); |
| 666 | |||
| 667 | enum { | ||
| 668 | MLX4_DOMAIN_UVERBS = 0x1000, | ||
| 669 | MLX4_DOMAIN_ETHTOOL = 0x2000, | ||
| 670 | MLX4_DOMAIN_RFS = 0x3000, | ||
| 671 | MLX4_DOMAIN_NIC = 0x5000, | ||
| 672 | }; | ||
| 673 | |||
| 674 | enum mlx4_net_trans_rule_id { | ||
| 675 | MLX4_NET_TRANS_RULE_ID_ETH = 0, | ||
| 676 | MLX4_NET_TRANS_RULE_ID_IB, | ||
| 677 | MLX4_NET_TRANS_RULE_ID_IPV6, | ||
| 678 | MLX4_NET_TRANS_RULE_ID_IPV4, | ||
| 679 | MLX4_NET_TRANS_RULE_ID_TCP, | ||
| 680 | MLX4_NET_TRANS_RULE_ID_UDP, | ||
| 681 | MLX4_NET_TRANS_RULE_NUM, /* should be last */ | ||
| 682 | }; | ||
| 683 | |||
| 684 | enum mlx4_net_trans_promisc_mode { | ||
| 685 | MLX4_FS_PROMISC_NONE = 0, | ||
| 686 | MLX4_FS_PROMISC_UPLINK, | ||
| 687 | /* For future use. Not implemented yet */ | ||
| 688 | MLX4_FS_PROMISC_FUNCTION_PORT, | ||
| 689 | MLX4_FS_PROMISC_ALL_MULTI, | ||
| 690 | }; | ||
| 691 | |||
| 692 | struct mlx4_spec_eth { | ||
| 693 | u8 dst_mac[6]; | ||
| 694 | u8 dst_mac_msk[6]; | ||
| 695 | u8 src_mac[6]; | ||
| 696 | u8 src_mac_msk[6]; | ||
| 697 | u8 ether_type_enable; | ||
| 698 | __be16 ether_type; | ||
| 699 | __be16 vlan_id_msk; | ||
| 700 | __be16 vlan_id; | ||
| 701 | }; | ||
| 702 | |||
| 703 | struct mlx4_spec_tcp_udp { | ||
| 704 | __be16 dst_port; | ||
| 705 | __be16 dst_port_msk; | ||
| 706 | __be16 src_port; | ||
| 707 | __be16 src_port_msk; | ||
| 708 | }; | ||
| 709 | |||
| 710 | struct mlx4_spec_ipv4 { | ||
| 711 | __be32 dst_ip; | ||
| 712 | __be32 dst_ip_msk; | ||
| 713 | __be32 src_ip; | ||
| 714 | __be32 src_ip_msk; | ||
| 715 | }; | ||
| 716 | |||
| 717 | struct mlx4_spec_ib { | ||
| 718 | __be32 r_qpn; | ||
| 719 | __be32 qpn_msk; | ||
| 720 | u8 dst_gid[16]; | ||
| 721 | u8 dst_gid_msk[16]; | ||
| 722 | }; | ||
| 723 | |||
| 724 | struct mlx4_spec_list { | ||
| 725 | struct list_head list; | ||
| 726 | enum mlx4_net_trans_rule_id id; | ||
| 727 | union { | ||
| 728 | struct mlx4_spec_eth eth; | ||
| 729 | struct mlx4_spec_ib ib; | ||
| 730 | struct mlx4_spec_ipv4 ipv4; | ||
| 731 | struct mlx4_spec_tcp_udp tcp_udp; | ||
| 732 | }; | ||
| 733 | }; | ||
| 734 | |||
| 735 | enum mlx4_net_trans_hw_rule_queue { | ||
| 736 | MLX4_NET_TRANS_Q_FIFO, | ||
| 737 | MLX4_NET_TRANS_Q_LIFO, | ||
| 738 | }; | ||
| 739 | |||
| 740 | struct mlx4_net_trans_rule { | ||
| 741 | struct list_head list; | ||
| 742 | enum mlx4_net_trans_hw_rule_queue queue_mode; | ||
| 743 | bool exclusive; | ||
| 744 | bool allow_loopback; | ||
| 745 | enum mlx4_net_trans_promisc_mode promisc_mode; | ||
| 746 | u8 port; | ||
| 747 | u16 priority; | ||
| 748 | u32 qpn; | ||
| 749 | }; | ||
| 750 | |||
| 751 | int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, | ||
| 752 | enum mlx4_net_trans_promisc_mode mode); | ||
| 753 | int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, | ||
| 754 | enum mlx4_net_trans_promisc_mode mode); | ||
| 629 | int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); | 755 | int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); |
| 630 | int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); | 756 | int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port); |
| 631 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); | 757 | int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port); |
| @@ -659,7 +785,8 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr, | |||
| 659 | int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); | 785 | int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); |
| 660 | int mlx4_SYNC_TPT(struct mlx4_dev *dev); | 786 | int mlx4_SYNC_TPT(struct mlx4_dev *dev); |
| 661 | int mlx4_test_interrupts(struct mlx4_dev *dev); | 787 | int mlx4_test_interrupts(struct mlx4_dev *dev); |
| 662 | int mlx4_assign_eq(struct mlx4_dev *dev, char* name , int* vector); | 788 | int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap, |
| 789 | int *vector); | ||
| 663 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); | 790 | void mlx4_release_eq(struct mlx4_dev *dev, int vec); |
| 664 | 791 | ||
| 665 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); | 792 | int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); |
| @@ -668,4 +795,8 @@ int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); | |||
| 668 | int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); | 795 | int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx); |
| 669 | void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); | 796 | void mlx4_counter_free(struct mlx4_dev *dev, u32 idx); |
| 670 | 797 | ||
| 798 | int mlx4_flow_attach(struct mlx4_dev *dev, | ||
| 799 | struct mlx4_net_trans_rule *rule, u64 *reg_id); | ||
| 800 | int mlx4_flow_detach(struct mlx4_dev *dev, u64 reg_id); | ||
| 801 | |||
| 671 | #endif /* MLX4_DEVICE_H */ | 802 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h index 5f1298b1b5ef..8dc485febc6b 100644 --- a/include/linux/mlx4/driver.h +++ b/include/linux/mlx4/driver.h | |||
| @@ -37,6 +37,8 @@ | |||
| 37 | 37 | ||
| 38 | struct mlx4_dev; | 38 | struct mlx4_dev; |
| 39 | 39 | ||
| 40 | #define MLX4_MAC_MASK 0xffffffffffffULL | ||
| 41 | |||
| 40 | enum mlx4_dev_event { | 42 | enum mlx4_dev_event { |
| 41 | MLX4_DEV_EVENT_CATASTROPHIC_ERROR, | 43 | MLX4_DEV_EVENT_CATASTROPHIC_ERROR, |
| 42 | MLX4_DEV_EVENT_PORT_UP, | 44 | MLX4_DEV_EVENT_PORT_UP, |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 68c569fcbb66..458988bd55a1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -188,7 +188,7 @@ static inline int is_unevictable_lru(enum lru_list lru) | |||
| 188 | struct zone_reclaim_stat { | 188 | struct zone_reclaim_stat { |
| 189 | /* | 189 | /* |
| 190 | * The pageout code in vmscan.c keeps track of how many of the | 190 | * The pageout code in vmscan.c keeps track of how many of the |
| 191 | * mem/swap backed and file backed pages are refeferenced. | 191 | * mem/swap backed and file backed pages are referenced. |
| 192 | * The higher the rotated/scanned ratio, the more valuable | 192 | * The higher the rotated/scanned ratio, the more valuable |
| 193 | * that cache is. | 193 | * that cache is. |
| 194 | * | 194 | * |
diff --git a/include/linux/net.h b/include/linux/net.h index e9ac2df079ba..99276c3dc89a 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -72,6 +72,7 @@ struct net; | |||
| 72 | #define SOCK_NOSPACE 2 | 72 | #define SOCK_NOSPACE 2 |
| 73 | #define SOCK_PASSCRED 3 | 73 | #define SOCK_PASSCRED 3 |
| 74 | #define SOCK_PASSSEC 4 | 74 | #define SOCK_PASSSEC 4 |
| 75 | #define SOCK_EXTERNALLY_ALLOCATED 5 | ||
| 75 | 76 | ||
| 76 | #ifndef ARCH_HAS_SOCKET_TYPES | 77 | #ifndef ARCH_HAS_SOCKET_TYPES |
| 77 | /** | 78 | /** |
| @@ -247,6 +248,7 @@ extern int sock_recvmsg(struct socket *sock, struct msghdr *msg, | |||
| 247 | size_t size, int flags); | 248 | size_t size, int flags); |
| 248 | extern int sock_map_fd(struct socket *sock, int flags); | 249 | extern int sock_map_fd(struct socket *sock, int flags); |
| 249 | extern struct socket *sockfd_lookup(int fd, int *err); | 250 | extern struct socket *sockfd_lookup(int fd, int *err); |
| 251 | extern struct socket *sock_from_file(struct file *file, int *err); | ||
| 250 | #define sockfd_put(sock) fput(sock->file) | 252 | #define sockfd_put(sock) fput(sock->file) |
| 251 | extern int net_ratelimit(void); | 253 | extern int net_ratelimit(void); |
| 252 | 254 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d94cb1431519..eb06e58bed0b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -1046,10 +1046,9 @@ struct net_device { | |||
| 1046 | */ | 1046 | */ |
| 1047 | char name[IFNAMSIZ]; | 1047 | char name[IFNAMSIZ]; |
| 1048 | 1048 | ||
| 1049 | struct pm_qos_request pm_qos_req; | 1049 | /* device name hash chain, please keep it close to name[] */ |
| 1050 | |||
| 1051 | /* device name hash chain */ | ||
| 1052 | struct hlist_node name_hlist; | 1050 | struct hlist_node name_hlist; |
| 1051 | |||
| 1053 | /* snmp alias */ | 1052 | /* snmp alias */ |
| 1054 | char *ifalias; | 1053 | char *ifalias; |
| 1055 | 1054 | ||
| @@ -1322,6 +1321,8 @@ struct net_device { | |||
| 1322 | 1321 | ||
| 1323 | /* group the device belongs to */ | 1322 | /* group the device belongs to */ |
| 1324 | int group; | 1323 | int group; |
| 1324 | |||
| 1325 | struct pm_qos_request pm_qos_req; | ||
| 1325 | }; | 1326 | }; |
| 1326 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 1327 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
| 1327 | 1328 | ||
| @@ -1626,6 +1627,7 @@ extern int dev_alloc_name(struct net_device *dev, const char *name); | |||
| 1626 | extern int dev_open(struct net_device *dev); | 1627 | extern int dev_open(struct net_device *dev); |
| 1627 | extern int dev_close(struct net_device *dev); | 1628 | extern int dev_close(struct net_device *dev); |
| 1628 | extern void dev_disable_lro(struct net_device *dev); | 1629 | extern void dev_disable_lro(struct net_device *dev); |
| 1630 | extern int dev_loopback_xmit(struct sk_buff *newskb); | ||
| 1629 | extern int dev_queue_xmit(struct sk_buff *skb); | 1631 | extern int dev_queue_xmit(struct sk_buff *skb); |
| 1630 | extern int register_netdevice(struct net_device *dev); | 1632 | extern int register_netdevice(struct net_device *dev); |
| 1631 | extern void unregister_netdevice_queue(struct net_device *dev, | 1633 | extern void unregister_netdevice_queue(struct net_device *dev, |
| @@ -2108,7 +2110,12 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev, | |||
| 2108 | static inline int netif_copy_real_num_queues(struct net_device *to_dev, | 2110 | static inline int netif_copy_real_num_queues(struct net_device *to_dev, |
| 2109 | const struct net_device *from_dev) | 2111 | const struct net_device *from_dev) |
| 2110 | { | 2112 | { |
| 2111 | netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues); | 2113 | int err; |
| 2114 | |||
| 2115 | err = netif_set_real_num_tx_queues(to_dev, | ||
| 2116 | from_dev->real_num_tx_queues); | ||
| 2117 | if (err) | ||
| 2118 | return err; | ||
| 2112 | #ifdef CONFIG_RPS | 2119 | #ifdef CONFIG_RPS |
| 2113 | return netif_set_real_num_rx_queues(to_dev, | 2120 | return netif_set_real_num_rx_queues(to_dev, |
| 2114 | from_dev->real_num_rx_queues); | 2121 | from_dev->real_num_rx_queues); |
| @@ -2117,6 +2124,9 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev, | |||
| 2117 | #endif | 2124 | #endif |
| 2118 | } | 2125 | } |
| 2119 | 2126 | ||
| 2127 | #define DEFAULT_MAX_NUM_RSS_QUEUES (8) | ||
| 2128 | extern int netif_get_num_default_rss_queues(void); | ||
| 2129 | |||
| 2120 | /* Use this variant when it is known for sure that it | 2130 | /* Use this variant when it is known for sure that it |
| 2121 | * is executing from hardware interrupt context or with hardware interrupts | 2131 | * is executing from hardware interrupt context or with hardware interrupts |
| 2122 | * disabled. | 2132 | * disabled. |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index ff9c84c29b28..c613cf0d7884 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -94,6 +94,16 @@ static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1, | |||
| 94 | a1->all[3] == a2->all[3]; | 94 | a1->all[3] == a2->all[3]; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static inline void nf_inet_addr_mask(const union nf_inet_addr *a1, | ||
| 98 | union nf_inet_addr *result, | ||
| 99 | const union nf_inet_addr *mask) | ||
| 100 | { | ||
| 101 | result->all[0] = a1->all[0] & mask->all[0]; | ||
| 102 | result->all[1] = a1->all[1] & mask->all[1]; | ||
| 103 | result->all[2] = a1->all[2] & mask->all[2]; | ||
| 104 | result->all[3] = a1->all[3] & mask->all[3]; | ||
| 105 | } | ||
| 106 | |||
| 97 | extern void netfilter_init(void); | 107 | extern void netfilter_init(void); |
| 98 | 108 | ||
| 99 | /* Largest hook number + 1 */ | 109 | /* Largest hook number + 1 */ |
| @@ -383,6 +393,22 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) | |||
| 383 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; | 393 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; |
| 384 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | 394 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); |
| 385 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; | 395 | extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; |
| 396 | |||
| 397 | struct nf_conn; | ||
| 398 | struct nlattr; | ||
| 399 | |||
| 400 | struct nfq_ct_hook { | ||
| 401 | size_t (*build_size)(const struct nf_conn *ct); | ||
| 402 | int (*build)(struct sk_buff *skb, struct nf_conn *ct); | ||
| 403 | int (*parse)(const struct nlattr *attr, struct nf_conn *ct); | ||
| 404 | }; | ||
| 405 | extern struct nfq_ct_hook __rcu *nfq_ct_hook; | ||
| 406 | |||
| 407 | struct nfq_ct_nat_hook { | ||
| 408 | void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, | ||
| 409 | u32 ctinfo, int off); | ||
| 410 | }; | ||
| 411 | extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; | ||
| 386 | #else | 412 | #else |
| 387 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 413 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
| 388 | #endif | 414 | #endif |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 1697036336b6..874ae8f2706b 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -10,6 +10,7 @@ header-y += nfnetlink.h | |||
| 10 | header-y += nfnetlink_acct.h | 10 | header-y += nfnetlink_acct.h |
| 11 | header-y += nfnetlink_compat.h | 11 | header-y += nfnetlink_compat.h |
| 12 | header-y += nfnetlink_conntrack.h | 12 | header-y += nfnetlink_conntrack.h |
| 13 | header-y += nfnetlink_cthelper.h | ||
| 13 | header-y += nfnetlink_cttimeout.h | 14 | header-y += nfnetlink_cttimeout.h |
| 14 | header-y += nfnetlink_log.h | 15 | header-y += nfnetlink_log.h |
| 15 | header-y += nfnetlink_queue.h | 16 | header-y += nfnetlink_queue.h |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 0ce91d56a5f2..0dfc8b7210a3 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | #define __NF_CONNTRACK_SIP_H__ | 2 | #define __NF_CONNTRACK_SIP_H__ |
| 3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
| 4 | 4 | ||
| 5 | #include <net/netfilter/nf_conntrack_expect.h> | ||
| 6 | |||
| 5 | #define SIP_PORT 5060 | 7 | #define SIP_PORT 5060 |
| 6 | #define SIP_TIMEOUT 3600 | 8 | #define SIP_TIMEOUT 3600 |
| 7 | 9 | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index a1048c1587d1..18341cdb2443 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -50,7 +50,8 @@ struct nfgenmsg { | |||
| 50 | #define NFNL_SUBSYS_IPSET 6 | 50 | #define NFNL_SUBSYS_IPSET 6 |
| 51 | #define NFNL_SUBSYS_ACCT 7 | 51 | #define NFNL_SUBSYS_ACCT 7 |
| 52 | #define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 | 52 | #define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 |
| 53 | #define NFNL_SUBSYS_COUNT 9 | 53 | #define NFNL_SUBSYS_CTHELPER 9 |
| 54 | #define NFNL_SUBSYS_COUNT 10 | ||
| 54 | 55 | ||
| 55 | #ifdef __KERNEL__ | 56 | #ifdef __KERNEL__ |
| 56 | 57 | ||
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index e58e4b93c108..f649f7423ca2 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -7,6 +7,8 @@ enum cntl_msg_types { | |||
| 7 | IPCTNL_MSG_CT_GET, | 7 | IPCTNL_MSG_CT_GET, |
| 8 | IPCTNL_MSG_CT_DELETE, | 8 | IPCTNL_MSG_CT_DELETE, |
| 9 | IPCTNL_MSG_CT_GET_CTRZERO, | 9 | IPCTNL_MSG_CT_GET_CTRZERO, |
| 10 | IPCTNL_MSG_CT_GET_STATS_CPU, | ||
| 11 | IPCTNL_MSG_CT_GET_STATS, | ||
| 10 | 12 | ||
| 11 | IPCTNL_MSG_MAX | 13 | IPCTNL_MSG_MAX |
| 12 | }; | 14 | }; |
| @@ -15,6 +17,7 @@ enum ctnl_exp_msg_types { | |||
| 15 | IPCTNL_MSG_EXP_NEW, | 17 | IPCTNL_MSG_EXP_NEW, |
| 16 | IPCTNL_MSG_EXP_GET, | 18 | IPCTNL_MSG_EXP_GET, |
| 17 | IPCTNL_MSG_EXP_DELETE, | 19 | IPCTNL_MSG_EXP_DELETE, |
| 20 | IPCTNL_MSG_EXP_GET_STATS_CPU, | ||
| 18 | 21 | ||
| 19 | IPCTNL_MSG_EXP_MAX | 22 | IPCTNL_MSG_EXP_MAX |
| 20 | }; | 23 | }; |
| @@ -191,6 +194,7 @@ enum ctattr_expect_nat { | |||
| 191 | enum ctattr_help { | 194 | enum ctattr_help { |
| 192 | CTA_HELP_UNSPEC, | 195 | CTA_HELP_UNSPEC, |
| 193 | CTA_HELP_NAME, | 196 | CTA_HELP_NAME, |
| 197 | CTA_HELP_INFO, | ||
| 194 | __CTA_HELP_MAX | 198 | __CTA_HELP_MAX |
| 195 | }; | 199 | }; |
| 196 | #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) | 200 | #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) |
| @@ -202,4 +206,39 @@ enum ctattr_secctx { | |||
| 202 | }; | 206 | }; |
| 203 | #define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) | 207 | #define CTA_SECCTX_MAX (__CTA_SECCTX_MAX - 1) |
| 204 | 208 | ||
| 209 | enum ctattr_stats_cpu { | ||
| 210 | CTA_STATS_UNSPEC, | ||
| 211 | CTA_STATS_SEARCHED, | ||
| 212 | CTA_STATS_FOUND, | ||
| 213 | CTA_STATS_NEW, | ||
| 214 | CTA_STATS_INVALID, | ||
| 215 | CTA_STATS_IGNORE, | ||
| 216 | CTA_STATS_DELETE, | ||
| 217 | CTA_STATS_DELETE_LIST, | ||
| 218 | CTA_STATS_INSERT, | ||
| 219 | CTA_STATS_INSERT_FAILED, | ||
| 220 | CTA_STATS_DROP, | ||
| 221 | CTA_STATS_EARLY_DROP, | ||
| 222 | CTA_STATS_ERROR, | ||
| 223 | CTA_STATS_SEARCH_RESTART, | ||
| 224 | __CTA_STATS_MAX, | ||
| 225 | }; | ||
| 226 | #define CTA_STATS_MAX (__CTA_STATS_MAX - 1) | ||
| 227 | |||
| 228 | enum ctattr_stats_global { | ||
| 229 | CTA_STATS_GLOBAL_UNSPEC, | ||
| 230 | CTA_STATS_GLOBAL_ENTRIES, | ||
| 231 | __CTA_STATS_GLOBAL_MAX, | ||
| 232 | }; | ||
| 233 | #define CTA_STATS_GLOBAL_MAX (__CTA_STATS_GLOBAL_MAX - 1) | ||
| 234 | |||
| 235 | enum ctattr_expect_stats { | ||
| 236 | CTA_STATS_EXP_UNSPEC, | ||
| 237 | CTA_STATS_EXP_NEW, | ||
| 238 | CTA_STATS_EXP_CREATE, | ||
| 239 | CTA_STATS_EXP_DELETE, | ||
| 240 | __CTA_STATS_EXP_MAX, | ||
| 241 | }; | ||
| 242 | #define CTA_STATS_EXP_MAX (__CTA_STATS_EXP_MAX - 1) | ||
| 243 | |||
| 205 | #endif /* _IPCONNTRACK_NETLINK_H */ | 244 | #endif /* _IPCONNTRACK_NETLINK_H */ |
diff --git a/include/linux/netfilter/nfnetlink_cthelper.h b/include/linux/netfilter/nfnetlink_cthelper.h new file mode 100644 index 000000000000..33659f6fad3e --- /dev/null +++ b/include/linux/netfilter/nfnetlink_cthelper.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #ifndef _NFNL_CTHELPER_H_ | ||
| 2 | #define _NFNL_CTHELPER_H_ | ||
| 3 | |||
| 4 | #define NFCT_HELPER_STATUS_DISABLED 0 | ||
| 5 | #define NFCT_HELPER_STATUS_ENABLED 1 | ||
| 6 | |||
| 7 | enum nfnl_acct_msg_types { | ||
| 8 | NFNL_MSG_CTHELPER_NEW, | ||
| 9 | NFNL_MSG_CTHELPER_GET, | ||
| 10 | NFNL_MSG_CTHELPER_DEL, | ||
| 11 | NFNL_MSG_CTHELPER_MAX | ||
| 12 | }; | ||
| 13 | |||
| 14 | enum nfnl_cthelper_type { | ||
| 15 | NFCTH_UNSPEC, | ||
| 16 | NFCTH_NAME, | ||
| 17 | NFCTH_TUPLE, | ||
| 18 | NFCTH_QUEUE_NUM, | ||
| 19 | NFCTH_POLICY, | ||
| 20 | NFCTH_PRIV_DATA_LEN, | ||
| 21 | NFCTH_STATUS, | ||
| 22 | __NFCTH_MAX | ||
| 23 | }; | ||
| 24 | #define NFCTH_MAX (__NFCTH_MAX - 1) | ||
| 25 | |||
| 26 | enum nfnl_cthelper_policy_type { | ||
| 27 | NFCTH_POLICY_SET_UNSPEC, | ||
| 28 | NFCTH_POLICY_SET_NUM, | ||
| 29 | NFCTH_POLICY_SET, | ||
| 30 | NFCTH_POLICY_SET1 = NFCTH_POLICY_SET, | ||
| 31 | NFCTH_POLICY_SET2, | ||
| 32 | NFCTH_POLICY_SET3, | ||
| 33 | NFCTH_POLICY_SET4, | ||
| 34 | __NFCTH_POLICY_SET_MAX | ||
| 35 | }; | ||
| 36 | #define NFCTH_POLICY_SET_MAX (__NFCTH_POLICY_SET_MAX - 1) | ||
| 37 | |||
| 38 | enum nfnl_cthelper_pol_type { | ||
| 39 | NFCTH_POLICY_UNSPEC, | ||
| 40 | NFCTH_POLICY_NAME, | ||
| 41 | NFCTH_POLICY_EXPECT_MAX, | ||
| 42 | NFCTH_POLICY_EXPECT_TIMEOUT, | ||
| 43 | __NFCTH_POLICY_MAX | ||
| 44 | }; | ||
| 45 | #define NFCTH_POLICY_MAX (__NFCTH_POLICY_MAX - 1) | ||
| 46 | |||
| 47 | enum nfnl_cthelper_tuple_type { | ||
| 48 | NFCTH_TUPLE_UNSPEC, | ||
| 49 | NFCTH_TUPLE_L3PROTONUM, | ||
| 50 | NFCTH_TUPLE_L4PROTONUM, | ||
| 51 | __NFCTH_TUPLE_MAX, | ||
| 52 | }; | ||
| 53 | #define NFCTH_TUPLE_MAX (__NFCTH_TUPLE_MAX - 1) | ||
| 54 | |||
| 55 | #endif /* _NFNL_CTHELPER_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h index 24b32e6c009e..3b1c1360aedf 100644 --- a/include/linux/netfilter/nfnetlink_queue.h +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
| @@ -42,6 +42,8 @@ enum nfqnl_attr_type { | |||
| 42 | NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ | 42 | NFQA_IFINDEX_PHYSOUTDEV, /* __u32 ifindex */ |
| 43 | NFQA_HWADDR, /* nfqnl_msg_packet_hw */ | 43 | NFQA_HWADDR, /* nfqnl_msg_packet_hw */ |
| 44 | NFQA_PAYLOAD, /* opaque data payload */ | 44 | NFQA_PAYLOAD, /* opaque data payload */ |
| 45 | NFQA_CT, /* nf_conntrack_netlink.h */ | ||
| 46 | NFQA_CT_INFO, /* enum ip_conntrack_info */ | ||
| 45 | 47 | ||
| 46 | __NFQA_MAX | 48 | __NFQA_MAX |
| 47 | }; | 49 | }; |
| @@ -84,8 +86,15 @@ enum nfqnl_attr_config { | |||
| 84 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | 86 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ |
| 85 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | 87 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ |
| 86 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ | 88 | NFQA_CFG_QUEUE_MAXLEN, /* __u32 */ |
| 89 | NFQA_CFG_MASK, /* identify which flags to change */ | ||
| 90 | NFQA_CFG_FLAGS, /* value of these flags (__u32) */ | ||
| 87 | __NFQA_CFG_MAX | 91 | __NFQA_CFG_MAX |
| 88 | }; | 92 | }; |
| 89 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | 93 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) |
| 90 | 94 | ||
| 95 | /* Flags for NFQA_CFG_FLAGS */ | ||
| 96 | #define NFQA_CFG_F_FAIL_OPEN (1 << 0) | ||
| 97 | #define NFQA_CFG_F_CONNTRACK (1 << 1) | ||
| 98 | #define NFQA_CFG_F_MAX (1 << 2) | ||
| 99 | |||
| 91 | #endif /* _NFNETLINK_QUEUE_H */ | 100 | #endif /* _NFNETLINK_QUEUE_H */ |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index d1366f05d1b2..f1656096121e 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
| @@ -22,13 +22,8 @@ struct xt_connlimit_info { | |||
| 22 | #endif | 22 | #endif |
| 23 | }; | 23 | }; |
| 24 | unsigned int limit; | 24 | unsigned int limit; |
| 25 | union { | 25 | /* revision 1 */ |
| 26 | /* revision 0 */ | 26 | __u32 flags; |
| 27 | unsigned int inverse; | ||
| 28 | |||
| 29 | /* revision 1 */ | ||
| 30 | __u32 flags; | ||
| 31 | }; | ||
| 32 | 27 | ||
| 33 | /* Used internally by the kernel */ | 28 | /* Used internally by the kernel */ |
| 34 | struct xt_connlimit_data *data __attribute__((aligned(8))); | 29 | struct xt_connlimit_data *data __attribute__((aligned(8))); |
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h index 83318e01425e..6ef36c113e89 100644 --- a/include/linux/netfilter/xt_recent.h +++ b/include/linux/netfilter/xt_recent.h | |||
| @@ -32,4 +32,14 @@ struct xt_recent_mtinfo { | |||
| 32 | __u8 side; | 32 | __u8 side; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | struct xt_recent_mtinfo_v1 { | ||
| 36 | __u32 seconds; | ||
| 37 | __u32 hit_count; | ||
| 38 | __u8 check_set; | ||
| 39 | __u8 invert; | ||
| 40 | char name[XT_RECENT_NAME_LEN]; | ||
| 41 | __u8 side; | ||
| 42 | union nf_inet_addr mask; | ||
| 43 | }; | ||
| 44 | |||
| 35 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ | 45 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index fa0946c549d3..e2b12801378d 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
| @@ -66,6 +66,7 @@ enum nf_ip_hook_priorities { | |||
| 66 | NF_IP_PRI_SECURITY = 50, | 66 | NF_IP_PRI_SECURITY = 50, |
| 67 | NF_IP_PRI_NAT_SRC = 100, | 67 | NF_IP_PRI_NAT_SRC = 100, |
| 68 | NF_IP_PRI_SELINUX_LAST = 225, | 68 | NF_IP_PRI_SELINUX_LAST = 225, |
| 69 | NF_IP_PRI_CONNTRACK_HELPER = 300, | ||
| 69 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, | 70 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, |
| 70 | NF_IP_PRI_LAST = INT_MAX, | 71 | NF_IP_PRI_LAST = INT_MAX, |
| 71 | }; | 72 | }; |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index c61b8fb1a9ef..8ba0c5b72ea9 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
| @@ -5,7 +5,6 @@ header-y += ipt_LOG.h | |||
| 5 | header-y += ipt_REJECT.h | 5 | header-y += ipt_REJECT.h |
| 6 | header-y += ipt_TTL.h | 6 | header-y += ipt_TTL.h |
| 7 | header-y += ipt_ULOG.h | 7 | header-y += ipt_ULOG.h |
| 8 | header-y += ipt_addrtype.h | ||
| 9 | header-y += ipt_ah.h | 8 | header-y += ipt_ah.h |
| 10 | header-y += ipt_ecn.h | 9 | header-y += ipt_ecn.h |
| 11 | header-y += ipt_ttl.h | 10 | header-y += ipt_ttl.h |
diff --git a/include/linux/netfilter_ipv4/ipt_addrtype.h b/include/linux/netfilter_ipv4/ipt_addrtype.h deleted file mode 100644 index 0da42237c8da..000000000000 --- a/include/linux/netfilter_ipv4/ipt_addrtype.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | #ifndef _IPT_ADDRTYPE_H | ||
| 2 | #define _IPT_ADDRTYPE_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | enum { | ||
| 7 | IPT_ADDRTYPE_INVERT_SOURCE = 0x0001, | ||
| 8 | IPT_ADDRTYPE_INVERT_DEST = 0x0002, | ||
| 9 | IPT_ADDRTYPE_LIMIT_IFACE_IN = 0x0004, | ||
| 10 | IPT_ADDRTYPE_LIMIT_IFACE_OUT = 0x0008, | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct ipt_addrtype_info_v1 { | ||
| 14 | __u16 source; /* source-type mask */ | ||
| 15 | __u16 dest; /* dest-type mask */ | ||
| 16 | __u32 flags; | ||
| 17 | }; | ||
| 18 | |||
| 19 | /* revision 0 */ | ||
| 20 | struct ipt_addrtype_info { | ||
| 21 | __u16 source; /* source-type mask */ | ||
| 22 | __u16 dest; /* dest-type mask */ | ||
| 23 | __u32 invert_source; | ||
| 24 | __u32 invert_dest; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #endif | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 57c025127f1d..7c8a513ce7a3 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -71,6 +71,7 @@ enum nf_ip6_hook_priorities { | |||
| 71 | NF_IP6_PRI_SECURITY = 50, | 71 | NF_IP6_PRI_SECURITY = 50, |
| 72 | NF_IP6_PRI_NAT_SRC = 100, | 72 | NF_IP6_PRI_NAT_SRC = 100, |
| 73 | NF_IP6_PRI_SELINUX_LAST = 225, | 73 | NF_IP6_PRI_SELINUX_LAST = 225, |
| 74 | NF_IP6_PRI_CONNTRACK_HELPER = 300, | ||
| 74 | NF_IP6_PRI_LAST = INT_MAX, | 75 | NF_IP6_PRI_LAST = INT_MAX, |
| 75 | }; | 76 | }; |
| 76 | 77 | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 0f628ffa420c..f74dd133788f 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -174,11 +174,17 @@ struct netlink_skb_parms { | |||
| 174 | extern void netlink_table_grab(void); | 174 | extern void netlink_table_grab(void); |
| 175 | extern void netlink_table_ungrab(void); | 175 | extern void netlink_table_ungrab(void); |
| 176 | 176 | ||
| 177 | extern struct sock *netlink_kernel_create(struct net *net, | 177 | /* optional Netlink kernel configuration parameters */ |
| 178 | int unit,unsigned int groups, | 178 | struct netlink_kernel_cfg { |
| 179 | void (*input)(struct sk_buff *skb), | 179 | unsigned int groups; |
| 180 | struct mutex *cb_mutex, | 180 | void (*input)(struct sk_buff *skb); |
| 181 | struct module *module); | 181 | struct mutex *cb_mutex; |
| 182 | void (*bind)(int group); | ||
| 183 | }; | ||
| 184 | |||
| 185 | extern struct sock *netlink_kernel_create(struct net *net, int unit, | ||
| 186 | struct module *module, | ||
| 187 | struct netlink_kernel_cfg *cfg); | ||
| 182 | extern void netlink_kernel_release(struct sock *sk); | 188 | extern void netlink_kernel_release(struct sock *sk); |
| 183 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); | 189 | extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); |
| 184 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); | 190 | extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
| @@ -241,14 +247,6 @@ struct netlink_notify { | |||
| 241 | struct nlmsghdr * | 247 | struct nlmsghdr * |
| 242 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); | 248 | __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags); |
| 243 | 249 | ||
| 244 | #define NLMSG_NEW(skb, pid, seq, type, len, flags) \ | ||
| 245 | ({ if (unlikely(skb_tailroom(skb) < (int)NLMSG_SPACE(len))) \ | ||
| 246 | goto nlmsg_failure; \ | ||
| 247 | __nlmsg_put(skb, pid, seq, type, len, flags); }) | ||
| 248 | |||
| 249 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | ||
| 250 | NLMSG_NEW(skb, pid, seq, type, len, 0) | ||
| 251 | |||
| 252 | struct netlink_dump_control { | 250 | struct netlink_dump_control { |
| 253 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); | 251 | int (*dump)(struct sk_buff *skb, struct netlink_callback *); |
| 254 | int (*done)(struct netlink_callback*); | 252 | int (*done)(struct netlink_callback*); |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 5dfa091c3347..28f5389c924b 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -43,7 +43,7 @@ struct netpoll_info { | |||
| 43 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); | 43 | void netpoll_send_udp(struct netpoll *np, const char *msg, int len); |
| 44 | void netpoll_print_options(struct netpoll *np); | 44 | void netpoll_print_options(struct netpoll *np); |
| 45 | int netpoll_parse_options(struct netpoll *np, char *opt); | 45 | int netpoll_parse_options(struct netpoll *np, char *opt); |
| 46 | int __netpoll_setup(struct netpoll *np); | 46 | int __netpoll_setup(struct netpoll *np, struct net_device *ndev); |
| 47 | int netpoll_setup(struct netpoll *np); | 47 | int netpoll_setup(struct netpoll *np); |
| 48 | int netpoll_trap(void); | 48 | int netpoll_trap(void); |
| 49 | void netpoll_set_trap(int trap); | 49 | void netpoll_set_trap(int trap); |
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 0ae9b5857c83..6189f27e305b 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
| @@ -56,6 +56,10 @@ | |||
| 56 | * %NFC_ATTR_PROTOCOLS) | 56 | * %NFC_ATTR_PROTOCOLS) |
| 57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed | 57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed |
| 58 | * (it sends %NFC_ATTR_DEVICE_INDEX) | 58 | * (it sends %NFC_ATTR_DEVICE_INDEX) |
| 59 | * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in | ||
| 60 | * target mode. | ||
| 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | ||
| 62 | * from target mode. | ||
| 59 | */ | 63 | */ |
| 60 | enum nfc_commands { | 64 | enum nfc_commands { |
| 61 | NFC_CMD_UNSPEC, | 65 | NFC_CMD_UNSPEC, |
| @@ -71,6 +75,8 @@ enum nfc_commands { | |||
| 71 | NFC_EVENT_DEVICE_ADDED, | 75 | NFC_EVENT_DEVICE_ADDED, |
| 72 | NFC_EVENT_DEVICE_REMOVED, | 76 | NFC_EVENT_DEVICE_REMOVED, |
| 73 | NFC_EVENT_TARGET_LOST, | 77 | NFC_EVENT_TARGET_LOST, |
| 78 | NFC_EVENT_TM_ACTIVATED, | ||
| 79 | NFC_EVENT_TM_DEACTIVATED, | ||
| 74 | /* private: internal use only */ | 80 | /* private: internal use only */ |
| 75 | __NFC_CMD_AFTER_LAST | 81 | __NFC_CMD_AFTER_LAST |
| 76 | }; | 82 | }; |
| @@ -94,6 +100,8 @@ enum nfc_commands { | |||
| 94 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes | 100 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes |
| 95 | * @NFC_ATTR_COMM_MODE: Passive or active mode | 101 | * @NFC_ATTR_COMM_MODE: Passive or active mode |
| 96 | * @NFC_ATTR_RF_MODE: Initiator or target | 102 | * @NFC_ATTR_RF_MODE: Initiator or target |
| 103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | ||
| 104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | ||
| 97 | */ | 105 | */ |
| 98 | enum nfc_attrs { | 106 | enum nfc_attrs { |
| 99 | NFC_ATTR_UNSPEC, | 107 | NFC_ATTR_UNSPEC, |
| @@ -109,6 +117,8 @@ enum nfc_attrs { | |||
| 109 | NFC_ATTR_COMM_MODE, | 117 | NFC_ATTR_COMM_MODE, |
| 110 | NFC_ATTR_RF_MODE, | 118 | NFC_ATTR_RF_MODE, |
| 111 | NFC_ATTR_DEVICE_POWERED, | 119 | NFC_ATTR_DEVICE_POWERED, |
| 120 | NFC_ATTR_IM_PROTOCOLS, | ||
| 121 | NFC_ATTR_TM_PROTOCOLS, | ||
| 112 | /* private: internal use only */ | 122 | /* private: internal use only */ |
| 113 | __NFC_ATTR_AFTER_LAST | 123 | __NFC_ATTR_AFTER_LAST |
| 114 | }; | 124 | }; |
| @@ -118,6 +128,7 @@ enum nfc_attrs { | |||
| 118 | #define NFC_NFCID1_MAXSIZE 10 | 128 | #define NFC_NFCID1_MAXSIZE 10 |
| 119 | #define NFC_SENSB_RES_MAXSIZE 12 | 129 | #define NFC_SENSB_RES_MAXSIZE 12 |
| 120 | #define NFC_SENSF_RES_MAXSIZE 18 | 130 | #define NFC_SENSF_RES_MAXSIZE 18 |
| 131 | #define NFC_GB_MAXSIZE 48 | ||
| 121 | 132 | ||
| 122 | /* NFC protocols */ | 133 | /* NFC protocols */ |
| 123 | #define NFC_PROTO_JEWEL 1 | 134 | #define NFC_PROTO_JEWEL 1 |
| @@ -125,8 +136,9 @@ enum nfc_attrs { | |||
| 125 | #define NFC_PROTO_FELICA 3 | 136 | #define NFC_PROTO_FELICA 3 |
| 126 | #define NFC_PROTO_ISO14443 4 | 137 | #define NFC_PROTO_ISO14443 4 |
| 127 | #define NFC_PROTO_NFC_DEP 5 | 138 | #define NFC_PROTO_NFC_DEP 5 |
| 139 | #define NFC_PROTO_ISO14443_B 6 | ||
| 128 | 140 | ||
| 129 | #define NFC_PROTO_MAX 6 | 141 | #define NFC_PROTO_MAX 7 |
| 130 | 142 | ||
| 131 | /* NFC communication modes */ | 143 | /* NFC communication modes */ |
| 132 | #define NFC_COMM_ACTIVE 0 | 144 | #define NFC_COMM_ACTIVE 0 |
| @@ -135,13 +147,15 @@ enum nfc_attrs { | |||
| 135 | /* NFC RF modes */ | 147 | /* NFC RF modes */ |
| 136 | #define NFC_RF_INITIATOR 0 | 148 | #define NFC_RF_INITIATOR 0 |
| 137 | #define NFC_RF_TARGET 1 | 149 | #define NFC_RF_TARGET 1 |
| 150 | #define NFC_RF_NONE 2 | ||
| 138 | 151 | ||
| 139 | /* NFC protocols masks used in bitsets */ | 152 | /* NFC protocols masks used in bitsets */ |
| 140 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) | 153 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) |
| 141 | #define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE) | 154 | #define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE) |
| 142 | #define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA) | 155 | #define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA) |
| 143 | #define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443) | 156 | #define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443) |
| 144 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) | 157 | #define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP) |
| 158 | #define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) | ||
| 145 | 159 | ||
| 146 | struct sockaddr_nfc { | 160 | struct sockaddr_nfc { |
| 147 | sa_family_t sa_family; | 161 | sa_family_t sa_family; |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index a6959f72745e..2f3878806403 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -170,6 +170,8 @@ | |||
| 170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
| 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
| 172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
| 173 | * The channel to use can be set on the interface or be given using the | ||
| 174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | ||
| 173 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
| 174 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
| 175 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
| @@ -275,6 +277,12 @@ | |||
| 275 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to | 277 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to |
| 276 | * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) | 278 | * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) |
| 277 | * | 279 | * |
| 280 | * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC | ||
| 281 | * (for the BSSID) and %NL80211_ATTR_PMKID. | ||
| 282 | * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC | ||
| 283 | * (for the BSSID) and %NL80211_ATTR_PMKID. | ||
| 284 | * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. | ||
| 285 | * | ||
| 278 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain | 286 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain |
| 279 | * has been changed and provides details of the request information | 287 | * has been changed and provides details of the request information |
| 280 | * that caused the change such as who initiated the regulatory request | 288 | * that caused the change such as who initiated the regulatory request |
| @@ -454,6 +462,10 @@ | |||
| 454 | * the frame. | 462 | * the frame. |
| 455 | * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for | 463 | * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for |
| 456 | * backward compatibility. | 464 | * backward compatibility. |
| 465 | * | ||
| 466 | * @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE | ||
| 467 | * @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE | ||
| 468 | * | ||
| 457 | * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command | 469 | * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command |
| 458 | * is used to configure connection quality monitoring notification trigger | 470 | * is used to configure connection quality monitoring notification trigger |
| 459 | * levels. | 471 | * levels. |
| @@ -759,6 +771,9 @@ enum nl80211_commands { | |||
| 759 | * @NL80211_ATTR_IFNAME: network interface name | 771 | * @NL80211_ATTR_IFNAME: network interface name |
| 760 | * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype | 772 | * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype |
| 761 | * | 773 | * |
| 774 | * @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices | ||
| 775 | * that don't have a netdev (u64) | ||
| 776 | * | ||
| 762 | * @NL80211_ATTR_MAC: MAC address (various uses) | 777 | * @NL80211_ATTR_MAC: MAC address (various uses) |
| 763 | * | 778 | * |
| 764 | * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of | 779 | * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of |
| @@ -769,6 +784,13 @@ enum nl80211_commands { | |||
| 769 | * section 7.3.2.25.1, e.g. 0x000FAC04) | 784 | * section 7.3.2.25.1, e.g. 0x000FAC04) |
| 770 | * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and | 785 | * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and |
| 771 | * CCMP keys, each six bytes in little endian | 786 | * CCMP keys, each six bytes in little endian |
| 787 | * @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key | ||
| 788 | * @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the | ||
| 789 | * default management key | ||
| 790 | * @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or | ||
| 791 | * other commands, indicates which pairwise cipher suites are used | ||
| 792 | * @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or | ||
| 793 | * other commands, indicates which group cipher suite is used | ||
| 772 | * | 794 | * |
| 773 | * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU | 795 | * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU |
| 774 | * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing | 796 | * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing |
| @@ -1004,6 +1026,8 @@ enum nl80211_commands { | |||
| 1004 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was | 1026 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was |
| 1005 | * acknowledged by the recipient. | 1027 | * acknowledged by the recipient. |
| 1006 | * | 1028 | * |
| 1029 | * @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values. | ||
| 1030 | * | ||
| 1007 | * @NL80211_ATTR_CQM: connection quality monitor configuration in a | 1031 | * @NL80211_ATTR_CQM: connection quality monitor configuration in a |
| 1008 | * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. | 1032 | * nested attribute with %NL80211_ATTR_CQM_* sub-attributes. |
| 1009 | * | 1033 | * |
| @@ -1061,7 +1085,7 @@ enum nl80211_commands { | |||
| 1061 | * flag isn't set, the frame will be rejected. This is also used as an | 1085 | * flag isn't set, the frame will be rejected. This is also used as an |
| 1062 | * nl80211 capability flag. | 1086 | * nl80211 capability flag. |
| 1063 | * | 1087 | * |
| 1064 | * @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16) | 1088 | * @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16) |
| 1065 | * | 1089 | * |
| 1066 | * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags | 1090 | * @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags |
| 1067 | * attributes, specifying what a key should be set as default as. | 1091 | * attributes, specifying what a key should be set as default as. |
| @@ -1085,10 +1109,10 @@ enum nl80211_commands { | |||
| 1085 | * indicate which WoW triggers should be enabled. This is also | 1109 | * indicate which WoW triggers should be enabled. This is also |
| 1086 | * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN | 1110 | * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN |
| 1087 | * triggers. | 1111 | * triggers. |
| 1088 | 1112 | * | |
| 1089 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan | 1113 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan |
| 1090 | * cycles, in msecs. | 1114 | * cycles, in msecs. |
| 1091 | 1115 | * | |
| 1092 | * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more | 1116 | * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more |
| 1093 | * sets of attributes to match during scheduled scans. Only BSSs | 1117 | * sets of attributes to match during scheduled scans. Only BSSs |
| 1094 | * that match any of the sets will be reported. These are | 1118 | * that match any of the sets will be reported. These are |
| @@ -1115,7 +1139,7 @@ enum nl80211_commands { | |||
| 1115 | * are managed in software: interfaces of these types aren't subject to | 1139 | * are managed in software: interfaces of these types aren't subject to |
| 1116 | * any restrictions in their number or combinations. | 1140 | * any restrictions in their number or combinations. |
| 1117 | * | 1141 | * |
| 1118 | * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information | 1142 | * @NL80211_ATTR_REKEY_DATA: nested attribute containing the information |
| 1119 | * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. | 1143 | * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data. |
| 1120 | * | 1144 | * |
| 1121 | * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, | 1145 | * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan, |
| @@ -1182,7 +1206,6 @@ enum nl80211_commands { | |||
| 1182 | * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from | 1206 | * @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from |
| 1183 | * &enum nl80211_feature_flags and is advertised in wiphy information. | 1207 | * &enum nl80211_feature_flags and is advertised in wiphy information. |
| 1184 | * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe | 1208 | * @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe |
| 1185 | * | ||
| 1186 | * requests while operating in AP-mode. | 1209 | * requests while operating in AP-mode. |
| 1187 | * This attribute holds a bitmap of the supported protocols for | 1210 | * This attribute holds a bitmap of the supported protocols for |
| 1188 | * offloading (see &enum nl80211_probe_resp_offload_support_attr). | 1211 | * offloading (see &enum nl80211_probe_resp_offload_support_attr). |
| @@ -1222,6 +1245,12 @@ enum nl80211_commands { | |||
| 1222 | * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds | 1245 | * @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds |
| 1223 | * or 0 to disable background scan. | 1246 | * or 0 to disable background scan. |
| 1224 | * | 1247 | * |
| 1248 | * @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from | ||
| 1249 | * userspace. If unset it is assumed the hint comes directly from | ||
| 1250 | * a user. If set code could specify exactly what type of source | ||
| 1251 | * was used to provide the hint. For the different types of | ||
| 1252 | * allowed user regulatory hints see nl80211_user_reg_hint_type. | ||
| 1253 | * | ||
| 1225 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1254 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1226 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1255 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1227 | */ | 1256 | */ |
| @@ -1473,6 +1502,10 @@ enum nl80211_attrs { | |||
| 1473 | 1502 | ||
| 1474 | NL80211_ATTR_BG_SCAN_PERIOD, | 1503 | NL80211_ATTR_BG_SCAN_PERIOD, |
| 1475 | 1504 | ||
| 1505 | NL80211_ATTR_WDEV, | ||
| 1506 | |||
| 1507 | NL80211_ATTR_USER_REG_HINT_TYPE, | ||
| 1508 | |||
| 1476 | /* add attributes here, update the policy in nl80211.c */ | 1509 | /* add attributes here, update the policy in nl80211.c */ |
| 1477 | 1510 | ||
| 1478 | __NL80211_ATTR_AFTER_LAST, | 1511 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1520,6 +1553,13 @@ enum nl80211_attrs { | |||
| 1520 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1553 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
| 1521 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1554 | #define NL80211_MAX_NR_AKM_SUITES 2 |
| 1522 | 1555 | ||
| 1556 | #define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10 | ||
| 1557 | |||
| 1558 | /* default RSSI threshold for scan results if none specified. */ | ||
| 1559 | #define NL80211_SCAN_RSSI_THOLD_OFF -300 | ||
| 1560 | |||
| 1561 | #define NL80211_CQM_TXE_MAX_INTVL 1800 | ||
| 1562 | |||
| 1523 | /** | 1563 | /** |
| 1524 | * enum nl80211_iftype - (virtual) interface types | 1564 | * enum nl80211_iftype - (virtual) interface types |
| 1525 | * | 1565 | * |
| @@ -1613,12 +1653,20 @@ struct nl80211_sta_flag_update { | |||
| 1613 | * | 1653 | * |
| 1614 | * These attribute types are used with %NL80211_STA_INFO_TXRATE | 1654 | * These attribute types are used with %NL80211_STA_INFO_TXRATE |
| 1615 | * when getting information about the bitrate of a station. | 1655 | * when getting information about the bitrate of a station. |
| 1656 | * There are 2 attributes for bitrate, a legacy one that represents | ||
| 1657 | * a 16-bit value, and new one that represents a 32-bit value. | ||
| 1658 | * If the rate value fits into 16 bit, both attributes are reported | ||
| 1659 | * with the same value. If the rate is too high to fit into 16 bits | ||
| 1660 | * (>6.5535Gbps) only 32-bit attribute is included. | ||
| 1661 | * User space tools encouraged to use the 32-bit attribute and fall | ||
| 1662 | * back to the 16-bit one for compatibility with older kernels. | ||
| 1616 | * | 1663 | * |
| 1617 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | 1664 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved |
| 1618 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | 1665 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) |
| 1619 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | 1666 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) |
| 1620 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | 1667 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate |
| 1621 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | 1668 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval |
| 1669 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) | ||
| 1622 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined | 1670 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined |
| 1623 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 1671 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
| 1624 | */ | 1672 | */ |
| @@ -1628,6 +1676,7 @@ enum nl80211_rate_info { | |||
| 1628 | NL80211_RATE_INFO_MCS, | 1676 | NL80211_RATE_INFO_MCS, |
| 1629 | NL80211_RATE_INFO_40_MHZ_WIDTH, | 1677 | NL80211_RATE_INFO_40_MHZ_WIDTH, |
| 1630 | NL80211_RATE_INFO_SHORT_GI, | 1678 | NL80211_RATE_INFO_SHORT_GI, |
| 1679 | NL80211_RATE_INFO_BITRATE32, | ||
| 1631 | 1680 | ||
| 1632 | /* keep last */ | 1681 | /* keep last */ |
| 1633 | __NL80211_RATE_INFO_AFTER_LAST, | 1682 | __NL80211_RATE_INFO_AFTER_LAST, |
| @@ -1788,6 +1837,9 @@ enum nl80211_mpath_info { | |||
| 1788 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE | 1837 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE |
| 1789 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n | 1838 | * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n |
| 1790 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n | 1839 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n |
| 1840 | * @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as | ||
| 1841 | * defined in 802.11ac | ||
| 1842 | * @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE | ||
| 1791 | * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined | 1843 | * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined |
| 1792 | * @__NL80211_BAND_ATTR_AFTER_LAST: internal use | 1844 | * @__NL80211_BAND_ATTR_AFTER_LAST: internal use |
| 1793 | */ | 1845 | */ |
| @@ -1801,6 +1853,9 @@ enum nl80211_band_attr { | |||
| 1801 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, | 1853 | NL80211_BAND_ATTR_HT_AMPDU_FACTOR, |
| 1802 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, | 1854 | NL80211_BAND_ATTR_HT_AMPDU_DENSITY, |
| 1803 | 1855 | ||
| 1856 | NL80211_BAND_ATTR_VHT_MCS_SET, | ||
| 1857 | NL80211_BAND_ATTR_VHT_CAPA, | ||
| 1858 | |||
| 1804 | /* keep last */ | 1859 | /* keep last */ |
| 1805 | __NL80211_BAND_ATTR_AFTER_LAST, | 1860 | __NL80211_BAND_ATTR_AFTER_LAST, |
| 1806 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 | 1861 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 |
| @@ -1952,6 +2007,8 @@ enum nl80211_reg_rule_attr { | |||
| 1952 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved | 2007 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved |
| 1953 | * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, | 2008 | * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, |
| 1954 | * only report BSS with matching SSID. | 2009 | * only report BSS with matching SSID. |
| 2010 | * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a | ||
| 2011 | * BSS in scan results. Filtering is turned off if not specified. | ||
| 1955 | * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter | 2012 | * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter |
| 1956 | * attribute number currently defined | 2013 | * attribute number currently defined |
| 1957 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use | 2014 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use |
| @@ -1959,7 +2016,8 @@ enum nl80211_reg_rule_attr { | |||
| 1959 | enum nl80211_sched_scan_match_attr { | 2016 | enum nl80211_sched_scan_match_attr { |
| 1960 | __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, | 2017 | __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, |
| 1961 | 2018 | ||
| 1962 | NL80211_ATTR_SCHED_SCAN_MATCH_SSID, | 2019 | NL80211_SCHED_SCAN_MATCH_ATTR_SSID, |
| 2020 | NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, | ||
| 1963 | 2021 | ||
| 1964 | /* keep last */ | 2022 | /* keep last */ |
| 1965 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, | 2023 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, |
| @@ -1967,6 +2025,9 @@ enum nl80211_sched_scan_match_attr { | |||
| 1967 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 | 2025 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 |
| 1968 | }; | 2026 | }; |
| 1969 | 2027 | ||
| 2028 | /* only for backward compatibility */ | ||
| 2029 | #define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID | ||
| 2030 | |||
| 1970 | /** | 2031 | /** |
| 1971 | * enum nl80211_reg_rule_flags - regulatory rule flags | 2032 | * enum nl80211_reg_rule_flags - regulatory rule flags |
| 1972 | * | 2033 | * |
| @@ -2008,6 +2069,26 @@ enum nl80211_dfs_regions { | |||
| 2008 | }; | 2069 | }; |
| 2009 | 2070 | ||
| 2010 | /** | 2071 | /** |
| 2072 | * enum nl80211_user_reg_hint_type - type of user regulatory hint | ||
| 2073 | * | ||
| 2074 | * @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always | ||
| 2075 | * assumed if the attribute is not set. | ||
| 2076 | * @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular | ||
| 2077 | * base station. Device drivers that have been tested to work | ||
| 2078 | * properly to support this type of hint can enable these hints | ||
| 2079 | * by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature | ||
| 2080 | * capability on the struct wiphy. The wireless core will | ||
| 2081 | * ignore all cell base station hints until at least one device | ||
| 2082 | * present has been registered with the wireless core that | ||
| 2083 | * has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a | ||
| 2084 | * supported feature. | ||
| 2085 | */ | ||
| 2086 | enum nl80211_user_reg_hint_type { | ||
| 2087 | NL80211_USER_REG_HINT_USER = 0, | ||
| 2088 | NL80211_USER_REG_HINT_CELL_BASE = 1, | ||
| 2089 | }; | ||
| 2090 | |||
| 2091 | /** | ||
| 2011 | * enum nl80211_survey_info - survey information | 2092 | * enum nl80211_survey_info - survey information |
| 2012 | * | 2093 | * |
| 2013 | * These attribute types are used with %NL80211_ATTR_SURVEY_INFO | 2094 | * These attribute types are used with %NL80211_ATTR_SURVEY_INFO |
| @@ -2086,78 +2167,91 @@ enum nl80211_mntr_flags { | |||
| 2086 | * @__NL80211_MESHCONF_INVALID: internal use | 2167 | * @__NL80211_MESHCONF_INVALID: internal use |
| 2087 | * | 2168 | * |
| 2088 | * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in | 2169 | * @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in |
| 2089 | * millisecond units, used by the Peer Link Open message | 2170 | * millisecond units, used by the Peer Link Open message |
| 2090 | * | 2171 | * |
| 2091 | * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in | 2172 | * @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in |
| 2092 | * millisecond units, used by the peer link management to close a peer link | 2173 | * millisecond units, used by the peer link management to close a peer link |
| 2093 | * | 2174 | * |
| 2094 | * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in | 2175 | * @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in |
| 2095 | * millisecond units | 2176 | * millisecond units |
| 2096 | * | 2177 | * |
| 2097 | * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed | 2178 | * @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed |
| 2098 | * on this mesh interface | 2179 | * on this mesh interface |
| 2099 | * | 2180 | * |
| 2100 | * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link | 2181 | * @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link |
| 2101 | * open retries that can be sent to establish a new peer link instance in a | 2182 | * open retries that can be sent to establish a new peer link instance in a |
| 2102 | * mesh | 2183 | * mesh |
| 2103 | * | 2184 | * |
| 2104 | * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh | 2185 | * @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh |
| 2105 | * point. | 2186 | * point. |
| 2106 | * | 2187 | * |
| 2107 | * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically | 2188 | * @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically |
| 2108 | * open peer links when we detect compatible mesh peers. | 2189 | * open peer links when we detect compatible mesh peers. |
| 2109 | * | 2190 | * |
| 2110 | * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames | 2191 | * @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames |
| 2111 | * containing a PREQ that an MP can send to a particular destination (path | 2192 | * containing a PREQ that an MP can send to a particular destination (path |
| 2112 | * target) | 2193 | * target) |
| 2113 | * | 2194 | * |
| 2114 | * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths | 2195 | * @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths |
| 2115 | * (in milliseconds) | 2196 | * (in milliseconds) |
| 2116 | * | 2197 | * |
| 2117 | * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait | 2198 | * @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait |
| 2118 | * until giving up on a path discovery (in milliseconds) | 2199 | * until giving up on a path discovery (in milliseconds) |
| 2119 | * | 2200 | * |
| 2120 | * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh | 2201 | * @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh |
| 2121 | * points receiving a PREQ shall consider the forwarding information from the | 2202 | * points receiving a PREQ shall consider the forwarding information from |
| 2122 | * root to be valid. (TU = time unit) | 2203 | * the root to be valid. (TU = time unit) |
| 2123 | * | 2204 | * |
| 2124 | * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in | 2205 | * @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in |
| 2125 | * TUs) during which an MP can send only one action frame containing a PREQ | 2206 | * TUs) during which an MP can send only one action frame containing a PREQ |
| 2126 | * reference element | 2207 | * reference element |
| 2127 | * | 2208 | * |
| 2128 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | 2209 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) |
| 2129 | * that it takes for an HWMP information element to propagate across the mesh | 2210 | * that it takes for an HWMP information element to propagate across the |
| 2211 | * mesh | ||
| 2130 | * | 2212 | * |
| 2131 | * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not | 2213 | * @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not |
| 2132 | * | 2214 | * |
| 2133 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a | 2215 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a |
| 2134 | * source mesh point for path selection elements. | 2216 | * source mesh point for path selection elements. |
| 2135 | * | 2217 | * |
| 2136 | * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between | 2218 | * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between |
| 2137 | * root announcements are transmitted. | 2219 | * root announcements are transmitted. |
| 2138 | * | 2220 | * |
| 2139 | * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has | 2221 | * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has |
| 2140 | * access to a broader network beyond the MBSS. This is done via Root | 2222 | * access to a broader network beyond the MBSS. This is done via Root |
| 2141 | * Announcement frames. | 2223 | * Announcement frames. |
| 2142 | * | 2224 | * |
| 2143 | * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in | 2225 | * @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in |
| 2144 | * TUs) during which a mesh STA can send only one Action frame containing a | 2226 | * TUs) during which a mesh STA can send only one Action frame containing a |
| 2145 | * PERR element. | 2227 | * PERR element. |
| 2146 | * | 2228 | * |
| 2147 | * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding | 2229 | * @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding |
| 2148 | * or forwarding entity (default is TRUE - forwarding entity) | 2230 | * or forwarding entity (default is TRUE - forwarding entity) |
| 2149 | * | 2231 | * |
| 2150 | * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the | 2232 | * @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the |
| 2151 | * threshold for average signal strength of candidate station to establish | 2233 | * threshold for average signal strength of candidate station to establish |
| 2152 | * a peer link. | 2234 | * a peer link. |
| 2153 | * | ||
| 2154 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | ||
| 2155 | * | 2235 | * |
| 2156 | * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors | 2236 | * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors |
| 2157 | * to synchronize to for 11s default synchronization method (see 11C.12.2.2) | 2237 | * to synchronize to for 11s default synchronization method |
| 2238 | * (see 11C.12.2.2) | ||
| 2158 | * | 2239 | * |
| 2159 | * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. | 2240 | * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode. |
| 2160 | * | 2241 | * |
| 2242 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | ||
| 2243 | * | ||
| 2244 | * @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for | ||
| 2245 | * which mesh STAs receiving a proactive PREQ shall consider the forwarding | ||
| 2246 | * information to the root mesh STA to be valid. | ||
| 2247 | * | ||
| 2248 | * @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between | ||
| 2249 | * proactive PREQs are transmitted. | ||
| 2250 | * | ||
| 2251 | * @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time | ||
| 2252 | * (in TUs) during which a mesh STA can send only one Action frame | ||
| 2253 | * containing a PREQ element for root path confirmation. | ||
| 2254 | * | ||
| 2161 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 2255 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
| 2162 | */ | 2256 | */ |
| 2163 | enum nl80211_meshconf_params { | 2257 | enum nl80211_meshconf_params { |
| @@ -2184,6 +2278,9 @@ enum nl80211_meshconf_params { | |||
| 2184 | NL80211_MESHCONF_RSSI_THRESHOLD, | 2278 | NL80211_MESHCONF_RSSI_THRESHOLD, |
| 2185 | NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, | 2279 | NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR, |
| 2186 | NL80211_MESHCONF_HT_OPMODE, | 2280 | NL80211_MESHCONF_HT_OPMODE, |
| 2281 | NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT, | ||
| 2282 | NL80211_MESHCONF_HWMP_ROOT_INTERVAL, | ||
| 2283 | NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, | ||
| 2187 | 2284 | ||
| 2188 | /* keep last */ | 2285 | /* keep last */ |
| 2189 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 2286 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
| @@ -2199,34 +2296,36 @@ enum nl80211_meshconf_params { | |||
| 2199 | * @__NL80211_MESH_SETUP_INVALID: Internal use | 2296 | * @__NL80211_MESH_SETUP_INVALID: Internal use |
| 2200 | * | 2297 | * |
| 2201 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a | 2298 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a |
| 2202 | * vendor specific path selection algorithm or disable it to use the default | 2299 | * vendor specific path selection algorithm or disable it to use the |
| 2203 | * HWMP. | 2300 | * default HWMP. |
| 2204 | * | 2301 | * |
| 2205 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a | 2302 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a |
| 2206 | * vendor specific path metric or disable it to use the default Airtime | 2303 | * vendor specific path metric or disable it to use the default Airtime |
| 2207 | * metric. | 2304 | * metric. |
| 2208 | * | 2305 | * |
| 2209 | * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a | 2306 | * @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a |
| 2210 | * robust security network ie, or a vendor specific information element that | 2307 | * robust security network ie, or a vendor specific information element |
| 2211 | * vendors will use to identify the path selection methods and metrics in use. | 2308 | * that vendors will use to identify the path selection methods and |
| 2309 | * metrics in use. | ||
| 2212 | * | 2310 | * |
| 2213 | * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication | 2311 | * @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication |
| 2214 | * daemon will be authenticating mesh candidates. | 2312 | * daemon will be authenticating mesh candidates. |
| 2215 | * | 2313 | * |
| 2216 | * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication | 2314 | * @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication |
| 2217 | * daemon will be securing peer link frames. AMPE is a secured version of Mesh | 2315 | * daemon will be securing peer link frames. AMPE is a secured version of |
| 2218 | * Peering Management (MPM) and is implemented with the assistance of a | 2316 | * Mesh Peering Management (MPM) and is implemented with the assistance of |
| 2219 | * userspace daemon. When this flag is set, the kernel will send peer | 2317 | * a userspace daemon. When this flag is set, the kernel will send peer |
| 2220 | * management frames to a userspace daemon that will implement AMPE | 2318 | * management frames to a userspace daemon that will implement AMPE |
| 2221 | * functionality (security capabilities selection, key confirmation, and key | 2319 | * functionality (security capabilities selection, key confirmation, and |
| 2222 | * management). When the flag is unset (default), the kernel can autonomously | 2320 | * key management). When the flag is unset (default), the kernel can |
| 2223 | * complete (unsecured) mesh peering without the need of a userspace daemon. | 2321 | * autonomously complete (unsecured) mesh peering without the need of a |
| 2224 | * | 2322 | * userspace daemon. |
| 2225 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number | ||
| 2226 | * | 2323 | * |
| 2227 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a | 2324 | * @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a |
| 2228 | * vendor specific synchronization method or disable it to use the default | 2325 | * vendor specific synchronization method or disable it to use the default |
| 2229 | * neighbor offset synchronization | 2326 | * neighbor offset synchronization |
| 2327 | * | ||
| 2328 | * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number | ||
| 2230 | * | 2329 | * |
| 2231 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use | 2330 | * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use |
| 2232 | */ | 2331 | */ |
| @@ -2490,12 +2589,19 @@ enum nl80211_tx_rate_attributes { | |||
| 2490 | * enum nl80211_band - Frequency band | 2589 | * enum nl80211_band - Frequency band |
| 2491 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band | 2590 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band |
| 2492 | * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) | 2591 | * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) |
| 2592 | * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) | ||
| 2493 | */ | 2593 | */ |
| 2494 | enum nl80211_band { | 2594 | enum nl80211_band { |
| 2495 | NL80211_BAND_2GHZ, | 2595 | NL80211_BAND_2GHZ, |
| 2496 | NL80211_BAND_5GHZ, | 2596 | NL80211_BAND_5GHZ, |
| 2597 | NL80211_BAND_60GHZ, | ||
| 2497 | }; | 2598 | }; |
| 2498 | 2599 | ||
| 2600 | /** | ||
| 2601 | * enum nl80211_ps_state - powersave state | ||
| 2602 | * @NL80211_PS_DISABLED: powersave is disabled | ||
| 2603 | * @NL80211_PS_ENABLED: powersave is enabled | ||
| 2604 | */ | ||
| 2499 | enum nl80211_ps_state { | 2605 | enum nl80211_ps_state { |
| 2500 | NL80211_PS_DISABLED, | 2606 | NL80211_PS_DISABLED, |
| 2501 | NL80211_PS_ENABLED, | 2607 | NL80211_PS_ENABLED, |
| @@ -2513,6 +2619,17 @@ enum nl80211_ps_state { | |||
| 2513 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event | 2619 | * @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event |
| 2514 | * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many | 2620 | * @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many |
| 2515 | * consecutive packets were not acknowledged by the peer | 2621 | * consecutive packets were not acknowledged by the peer |
| 2622 | * @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures | ||
| 2623 | * during the given %NL80211_ATTR_CQM_TXE_INTVL before an | ||
| 2624 | * %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and | ||
| 2625 | * %NL80211_ATTR_CQM_TXE_PKTS is generated. | ||
| 2626 | * @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given | ||
| 2627 | * %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is | ||
| 2628 | * checked. | ||
| 2629 | * @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic | ||
| 2630 | * interval in which %NL80211_ATTR_CQM_TXE_PKTS and | ||
| 2631 | * %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an | ||
| 2632 | * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. | ||
| 2516 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal | 2633 | * @__NL80211_ATTR_CQM_AFTER_LAST: internal |
| 2517 | * @NL80211_ATTR_CQM_MAX: highest key attribute | 2634 | * @NL80211_ATTR_CQM_MAX: highest key attribute |
| 2518 | */ | 2635 | */ |
| @@ -2522,6 +2639,9 @@ enum nl80211_attr_cqm { | |||
| 2522 | NL80211_ATTR_CQM_RSSI_HYST, | 2639 | NL80211_ATTR_CQM_RSSI_HYST, |
| 2523 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, | 2640 | NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT, |
| 2524 | NL80211_ATTR_CQM_PKT_LOSS_EVENT, | 2641 | NL80211_ATTR_CQM_PKT_LOSS_EVENT, |
| 2642 | NL80211_ATTR_CQM_TXE_RATE, | ||
| 2643 | NL80211_ATTR_CQM_TXE_PKTS, | ||
| 2644 | NL80211_ATTR_CQM_TXE_INTVL, | ||
| 2525 | 2645 | ||
| 2526 | /* keep last */ | 2646 | /* keep last */ |
| 2527 | __NL80211_ATTR_CQM_AFTER_LAST, | 2647 | __NL80211_ATTR_CQM_AFTER_LAST, |
| @@ -2534,10 +2654,14 @@ enum nl80211_attr_cqm { | |||
| 2534 | * configured threshold | 2654 | * configured threshold |
| 2535 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the | 2655 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the |
| 2536 | * configured threshold | 2656 | * configured threshold |
| 2657 | * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss. | ||
| 2658 | * (Note that deauth/disassoc will still follow if the AP is not | ||
| 2659 | * available. This event might get used as roaming event, etc.) | ||
| 2537 | */ | 2660 | */ |
| 2538 | enum nl80211_cqm_rssi_threshold_event { | 2661 | enum nl80211_cqm_rssi_threshold_event { |
| 2539 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, | 2662 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, |
| 2540 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, | 2663 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, |
| 2664 | NL80211_CQM_RSSI_BEACON_LOSS_EVENT, | ||
| 2541 | }; | 2665 | }; |
| 2542 | 2666 | ||
| 2543 | 2667 | ||
| @@ -2867,11 +2991,15 @@ enum nl80211_ap_sme_features { | |||
| 2867 | * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. | 2991 | * @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates. |
| 2868 | * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up | 2992 | * @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up |
| 2869 | * the connected inactive stations in AP mode. | 2993 | * the connected inactive stations in AP mode. |
| 2994 | * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested | ||
| 2995 | * to work properly to suppport receiving regulatory hints from | ||
| 2996 | * cellular base stations. | ||
| 2870 | */ | 2997 | */ |
| 2871 | enum nl80211_feature_flags { | 2998 | enum nl80211_feature_flags { |
| 2872 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 2999 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
| 2873 | NL80211_FEATURE_HT_IBSS = 1 << 1, | 3000 | NL80211_FEATURE_HT_IBSS = 1 << 1, |
| 2874 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, | 3001 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, |
| 3002 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, | ||
| 2875 | }; | 3003 | }; |
| 2876 | 3004 | ||
| 2877 | /** | 3005 | /** |
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index 5a3db3aa5f17..fd4f2d1cdf6c 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
| @@ -130,18 +130,8 @@ enum { | |||
| 130 | enum { | 130 | enum { |
| 131 | __IEEE802154_DEV_INVALID = -1, | 131 | __IEEE802154_DEV_INVALID = -1, |
| 132 | 132 | ||
| 133 | /* TODO: | 133 | IEEE802154_DEV_WPAN, |
| 134 | * Nowadays three device types supported by this stack at linux-zigbee | 134 | IEEE802154_DEV_MONITOR, |
| 135 | * project: WPAN = 0, MONITOR = 1 and SMAC = 2. | ||
| 136 | * | ||
| 137 | * Since this stack implementation exists many years, it's definitely | ||
| 138 | * bad idea to change the assigned values due to they are already used | ||
| 139 | * by third-party userspace software like: iz-tools, wireshark... | ||
| 140 | * | ||
| 141 | * Currently only monitor device is added and initialized by '1' for | ||
| 142 | * compatibility. | ||
| 143 | */ | ||
| 144 | IEEE802154_DEV_MONITOR = 1, | ||
| 145 | 135 | ||
| 146 | __IEEE802154_DEV_MAX, | 136 | __IEEE802154_DEV_MAX, |
| 147 | }; | 137 | }; |
diff --git a/include/linux/phy.h b/include/linux/phy.h index c291cae8ce32..93b3cf77f564 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -243,6 +243,15 @@ enum phy_state { | |||
| 243 | PHY_RESUMING | 243 | PHY_RESUMING |
| 244 | }; | 244 | }; |
| 245 | 245 | ||
| 246 | /** | ||
| 247 | * struct phy_c45_device_ids - 802.3-c45 Device Identifiers | ||
| 248 | * @devices_in_package: Bit vector of devices present. | ||
| 249 | * @device_ids: The device identifer for each present device. | ||
| 250 | */ | ||
| 251 | struct phy_c45_device_ids { | ||
| 252 | u32 devices_in_package; | ||
| 253 | u32 device_ids[8]; | ||
| 254 | }; | ||
| 246 | 255 | ||
| 247 | /* phy_device: An instance of a PHY | 256 | /* phy_device: An instance of a PHY |
| 248 | * | 257 | * |
| @@ -250,6 +259,8 @@ enum phy_state { | |||
| 250 | * bus: Pointer to the bus this PHY is on | 259 | * bus: Pointer to the bus this PHY is on |
| 251 | * dev: driver model device structure for this PHY | 260 | * dev: driver model device structure for this PHY |
| 252 | * phy_id: UID for this device found during discovery | 261 | * phy_id: UID for this device found during discovery |
| 262 | * c45_ids: 802.3-c45 Device Identifers if is_c45. | ||
| 263 | * is_c45: Set to true if this phy uses clause 45 addressing. | ||
| 253 | * state: state of the PHY for management purposes | 264 | * state: state of the PHY for management purposes |
| 254 | * dev_flags: Device-specific flags used by the PHY driver. | 265 | * dev_flags: Device-specific flags used by the PHY driver. |
| 255 | * addr: Bus address of PHY | 266 | * addr: Bus address of PHY |
| @@ -285,6 +296,9 @@ struct phy_device { | |||
| 285 | 296 | ||
| 286 | u32 phy_id; | 297 | u32 phy_id; |
| 287 | 298 | ||
| 299 | struct phy_c45_device_ids c45_ids; | ||
| 300 | bool is_c45; | ||
| 301 | |||
| 288 | enum phy_state state; | 302 | enum phy_state state; |
| 289 | 303 | ||
| 290 | u32 dev_flags; | 304 | u32 dev_flags; |
| @@ -412,6 +426,12 @@ struct phy_driver { | |||
| 412 | /* Clears up any memory if needed */ | 426 | /* Clears up any memory if needed */ |
| 413 | void (*remove)(struct phy_device *phydev); | 427 | void (*remove)(struct phy_device *phydev); |
| 414 | 428 | ||
| 429 | /* Returns true if this is a suitable driver for the given | ||
| 430 | * phydev. If NULL, matching is based on phy_id and | ||
| 431 | * phy_id_mask. | ||
| 432 | */ | ||
| 433 | int (*match_phy_device)(struct phy_device *phydev); | ||
| 434 | |||
| 415 | /* Handles ethtool queries for hardware time stamping. */ | 435 | /* Handles ethtool queries for hardware time stamping. */ |
| 416 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); | 436 | int (*ts_info)(struct phy_device *phydev, struct ethtool_ts_info *ti); |
| 417 | 437 | ||
| @@ -480,7 +500,9 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val) | |||
| 480 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | 500 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); |
| 481 | } | 501 | } |
| 482 | 502 | ||
| 483 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 503 | struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, |
| 504 | bool is_c45, struct phy_c45_device_ids *c45_ids); | ||
| 505 | struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); | ||
| 484 | int phy_device_register(struct phy_device *phy); | 506 | int phy_device_register(struct phy_device *phy); |
| 485 | int phy_init_hw(struct phy_device *phydev); | 507 | int phy_init_hw(struct phy_device *phydev); |
| 486 | struct phy_device * phy_attach(struct net_device *dev, | 508 | struct phy_device * phy_attach(struct net_device *dev, |
| @@ -511,7 +533,9 @@ int genphy_read_status(struct phy_device *phydev); | |||
| 511 | int genphy_suspend(struct phy_device *phydev); | 533 | int genphy_suspend(struct phy_device *phydev); |
| 512 | int genphy_resume(struct phy_device *phydev); | 534 | int genphy_resume(struct phy_device *phydev); |
| 513 | void phy_driver_unregister(struct phy_driver *drv); | 535 | void phy_driver_unregister(struct phy_driver *drv); |
| 536 | void phy_drivers_unregister(struct phy_driver *drv, int n); | ||
| 514 | int phy_driver_register(struct phy_driver *new_driver); | 537 | int phy_driver_register(struct phy_driver *new_driver); |
| 538 | int phy_drivers_register(struct phy_driver *new_driver, int n); | ||
| 515 | void phy_state_machine(struct work_struct *work); | 539 | void phy_state_machine(struct work_struct *work); |
| 516 | void phy_start_machine(struct phy_device *phydev, | 540 | void phy_start_machine(struct phy_device *phydev, |
| 517 | void (*handler)(struct net_device *)); | 541 | void (*handler)(struct net_device *)); |
| @@ -532,6 +556,11 @@ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, | |||
| 532 | int (*run)(struct phy_device *)); | 556 | int (*run)(struct phy_device *)); |
| 533 | int phy_scan_fixups(struct phy_device *phydev); | 557 | int phy_scan_fixups(struct phy_device *phydev); |
| 534 | 558 | ||
| 559 | int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); | ||
| 560 | int phy_get_eee_err(struct phy_device *phydev); | ||
| 561 | int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); | ||
| 562 | int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); | ||
| 563 | |||
| 535 | int __init mdio_bus_init(void); | 564 | int __init mdio_bus_init(void); |
| 536 | void mdio_bus_exit(void); | 565 | void mdio_bus_exit(void); |
| 537 | 566 | ||
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index defbde203d07..082eafaf026b 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
| @@ -451,8 +451,10 @@ enum { | |||
| 451 | #define TCF_EM_U32 3 | 451 | #define TCF_EM_U32 3 |
| 452 | #define TCF_EM_META 4 | 452 | #define TCF_EM_META 4 |
| 453 | #define TCF_EM_TEXT 5 | 453 | #define TCF_EM_TEXT 5 |
| 454 | #define TCF_EM_VLAN 6 | 454 | #define TCF_EM_VLAN 6 |
| 455 | #define TCF_EM_MAX 6 | 455 | #define TCF_EM_CANID 7 |
| 456 | #define TCF_EM_IPSET 8 | ||
| 457 | #define TCF_EM_MAX 8 | ||
| 456 | 458 | ||
| 457 | enum { | 459 | enum { |
| 458 | TCF_EM_PROG_TC | 460 | TCF_EM_PROG_TC |
diff --git a/include/linux/platform_data/mmp_audio.h b/include/linux/platform_data/mmp_audio.h new file mode 100644 index 000000000000..0f25d165abd6 --- /dev/null +++ b/include/linux/platform_data/mmp_audio.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * MMP Platform AUDIO Management | ||
| 3 | * | ||
| 4 | * Copyright (c) 2011 Marvell Semiconductors Inc. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef MMP_AUDIO_H | ||
| 13 | #define MMP_AUDIO_H | ||
| 14 | |||
| 15 | struct mmp_audio_platdata { | ||
| 16 | u32 period_max_capture; | ||
| 17 | u32 buffer_max_capture; | ||
| 18 | u32 period_max_playback; | ||
| 19 | u32 buffer_max_playback; | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif /* MMP_AUDIO_H */ | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 2c1de8982c85..db71c4ad8624 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -612,12 +612,6 @@ struct tcamsg { | |||
| 612 | #include <linux/mutex.h> | 612 | #include <linux/mutex.h> |
| 613 | #include <linux/netdevice.h> | 613 | #include <linux/netdevice.h> |
| 614 | 614 | ||
| 615 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | ||
| 616 | { | ||
| 617 | int len = strlen(str) + 1; | ||
| 618 | return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); | ||
| 619 | } | ||
| 620 | |||
| 621 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); | 615 | extern int rtnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, u32 group, int echo); |
| 622 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); | 616 | extern int rtnl_unicast(struct sk_buff *skb, struct net *net, u32 pid); |
| 623 | extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, | 617 | extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, |
| @@ -625,124 +619,7 @@ extern void rtnl_notify(struct sk_buff *skb, struct net *net, u32 pid, | |||
| 625 | extern void rtnl_set_sk_err(struct net *net, u32 group, int error); | 619 | extern void rtnl_set_sk_err(struct net *net, u32 group, int error); |
| 626 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); | 620 | extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); |
| 627 | extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, | 621 | extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, |
| 628 | u32 id, u32 ts, u32 tsage, long expires, | 622 | u32 id, long expires, u32 error); |
| 629 | u32 error); | ||
| 630 | |||
| 631 | extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); | ||
| 632 | |||
| 633 | #define RTA_PUT(skb, attrtype, attrlen, data) \ | ||
| 634 | ({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ | ||
| 635 | goto rtattr_failure; \ | ||
| 636 | __rta_fill(skb, attrtype, attrlen, data); }) | ||
| 637 | |||
| 638 | #define RTA_APPEND(skb, attrlen, data) \ | ||
| 639 | ({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ | ||
| 640 | goto rtattr_failure; \ | ||
| 641 | memcpy(skb_put(skb, attrlen), data, attrlen); }) | ||
| 642 | |||
| 643 | #define RTA_PUT_NOHDR(skb, attrlen, data) \ | ||
| 644 | ({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \ | ||
| 645 | memset(skb_tail_pointer(skb) - (RTA_ALIGN(attrlen) - attrlen), 0, \ | ||
| 646 | RTA_ALIGN(attrlen) - attrlen); }) | ||
| 647 | |||
| 648 | #define RTA_PUT_U8(skb, attrtype, value) \ | ||
| 649 | ({ u8 _tmp = (value); \ | ||
| 650 | RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); }) | ||
| 651 | |||
| 652 | #define RTA_PUT_U16(skb, attrtype, value) \ | ||
| 653 | ({ u16 _tmp = (value); \ | ||
| 654 | RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); }) | ||
| 655 | |||
| 656 | #define RTA_PUT_U32(skb, attrtype, value) \ | ||
| 657 | ({ u32 _tmp = (value); \ | ||
| 658 | RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); }) | ||
| 659 | |||
| 660 | #define RTA_PUT_U64(skb, attrtype, value) \ | ||
| 661 | ({ u64 _tmp = (value); \ | ||
| 662 | RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); }) | ||
| 663 | |||
| 664 | #define RTA_PUT_SECS(skb, attrtype, value) \ | ||
| 665 | RTA_PUT_U64(skb, attrtype, (value) / HZ) | ||
| 666 | |||
| 667 | #define RTA_PUT_MSECS(skb, attrtype, value) \ | ||
| 668 | RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value)) | ||
| 669 | |||
| 670 | #define RTA_PUT_STRING(skb, attrtype, value) \ | ||
| 671 | RTA_PUT(skb, attrtype, strlen(value) + 1, value) | ||
| 672 | |||
| 673 | #define RTA_PUT_FLAG(skb, attrtype) \ | ||
| 674 | RTA_PUT(skb, attrtype, 0, NULL); | ||
| 675 | |||
| 676 | #define RTA_NEST(skb, type) \ | ||
| 677 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ | ||
| 678 | RTA_PUT(skb, type, 0, NULL); \ | ||
| 679 | __start; }) | ||
| 680 | |||
| 681 | #define RTA_NEST_END(skb, start) \ | ||
| 682 | ({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | ||
| 683 | (skb)->len; }) | ||
| 684 | |||
| 685 | #define RTA_NEST_COMPAT(skb, type, attrlen, data) \ | ||
| 686 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ | ||
| 687 | RTA_PUT(skb, type, attrlen, data); \ | ||
| 688 | RTA_NEST(skb, type); \ | ||
| 689 | __start; }) | ||
| 690 | |||
| 691 | #define RTA_NEST_COMPAT_END(skb, start) \ | ||
| 692 | ({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \ | ||
| 693 | (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ | ||
| 694 | RTA_NEST_END(skb, __nest); \ | ||
| 695 | (skb)->len; }) | ||
| 696 | |||
| 697 | #define RTA_NEST_CANCEL(skb, start) \ | ||
| 698 | ({ if (start) \ | ||
| 699 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | ||
| 700 | -1; }) | ||
| 701 | |||
| 702 | #define RTA_GET_U8(rta) \ | ||
| 703 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \ | ||
| 704 | goto rtattr_failure; \ | ||
| 705 | *(u8 *) RTA_DATA(rta); }) | ||
| 706 | |||
| 707 | #define RTA_GET_U16(rta) \ | ||
| 708 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \ | ||
| 709 | goto rtattr_failure; \ | ||
| 710 | *(u16 *) RTA_DATA(rta); }) | ||
| 711 | |||
| 712 | #define RTA_GET_U32(rta) \ | ||
| 713 | ({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \ | ||
| 714 | goto rtattr_failure; \ | ||
| 715 | *(u32 *) RTA_DATA(rta); }) | ||
| 716 | |||
| 717 | #define RTA_GET_U64(rta) \ | ||
| 718 | ({ u64 _tmp; \ | ||
| 719 | if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \ | ||
| 720 | goto rtattr_failure; \ | ||
| 721 | memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \ | ||
| 722 | _tmp; }) | ||
| 723 | |||
| 724 | #define RTA_GET_FLAG(rta) (!!(rta)) | ||
| 725 | |||
| 726 | #define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ) | ||
| 727 | #define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta))) | ||
| 728 | |||
| 729 | static inline struct rtattr * | ||
| 730 | __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | ||
| 731 | { | ||
| 732 | struct rtattr *rta; | ||
| 733 | int size = RTA_LENGTH(attrlen); | ||
| 734 | |||
| 735 | rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); | ||
| 736 | rta->rta_type = attrtype; | ||
| 737 | rta->rta_len = size; | ||
| 738 | memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size); | ||
| 739 | return rta; | ||
| 740 | } | ||
| 741 | |||
| 742 | #define __RTA_PUT(skb, attrtype, attrlen) \ | ||
| 743 | ({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ | ||
| 744 | goto rtattr_failure; \ | ||
| 745 | __rta_reserve(skb, attrtype, attrlen); }) | ||
| 746 | 623 | ||
| 747 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | 624 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
| 748 | 625 | ||
| @@ -794,13 +671,6 @@ extern void __rtnl_unlock(void); | |||
| 794 | } \ | 671 | } \ |
| 795 | } while(0) | 672 | } while(0) |
| 796 | 673 | ||
| 797 | static inline u32 rtm_get_table(struct rtattr **rta, u8 table) | ||
| 798 | { | ||
| 799 | return RTA_GET_U32(rta[RTA_TABLE-1]); | ||
| 800 | rtattr_failure: | ||
| 801 | return table; | ||
| 802 | } | ||
| 803 | |||
| 804 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, | 674 | extern int ndo_dflt_fdb_dump(struct sk_buff *skb, |
| 805 | struct netlink_callback *cb, | 675 | struct netlink_callback *cb, |
| 806 | struct net_device *dev, | 676 | struct net_device *dev, |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 642cb7355df3..d205c4be7f5b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -1667,6 +1667,22 @@ static inline void skb_orphan(struct sk_buff *skb) | |||
| 1667 | } | 1667 | } |
| 1668 | 1668 | ||
| 1669 | /** | 1669 | /** |
| 1670 | * skb_orphan_frags - orphan the frags contained in a buffer | ||
| 1671 | * @skb: buffer to orphan frags from | ||
| 1672 | * @gfp_mask: allocation mask for replacement pages | ||
| 1673 | * | ||
| 1674 | * For each frag in the SKB which needs a destructor (i.e. has an | ||
| 1675 | * owner) create a copy of that frag and release the original | ||
| 1676 | * page by calling the destructor. | ||
| 1677 | */ | ||
| 1678 | static inline int skb_orphan_frags(struct sk_buff *skb, gfp_t gfp_mask) | ||
| 1679 | { | ||
| 1680 | if (likely(!(skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY))) | ||
| 1681 | return 0; | ||
| 1682 | return skb_copy_ubufs(skb, gfp_mask); | ||
| 1683 | } | ||
| 1684 | |||
| 1685 | /** | ||
| 1670 | * __skb_queue_purge - empty a list | 1686 | * __skb_queue_purge - empty a list |
| 1671 | * @list: list to empty | 1687 | * @list: list to empty |
| 1672 | * | 1688 | * |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 2e68f5ba0389..00bc189cb395 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -208,7 +208,6 @@ enum | |||
| 208 | LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */ | 208 | LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */ |
| 209 | LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */ | 209 | LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */ |
| 210 | LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */ | 210 | LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */ |
| 211 | LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */ | ||
| 212 | LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */ | 211 | LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */ |
| 213 | LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */ | 212 | LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */ |
| 214 | LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */ | 213 | LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */ |
| @@ -233,7 +232,13 @@ enum | |||
| 233 | LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ | 232 | LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ |
| 234 | LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ | 233 | LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ |
| 235 | LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ | 234 | LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ |
| 236 | LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ | 235 | LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ |
| 236 | LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */ | ||
| 237 | LINUX_MIB_TCPOFODROP, /* TCPOFODrop */ | ||
| 238 | LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */ | ||
| 239 | LINUX_MIB_TCPCHALLENGEACK, /* TCPChallengeACK */ | ||
| 240 | LINUX_MIB_TCPSYNCHALLENGE, /* TCPSYNChallenge */ | ||
| 241 | LINUX_MIB_TCPFASTOPENACTIVE, /* TCPFastOpenActive */ | ||
| 237 | __LINUX_MIB_MAX | 242 | __LINUX_MIB_MAX |
| 238 | }; | 243 | }; |
| 239 | 244 | ||
diff --git a/include/linux/sock_diag.h b/include/linux/sock_diag.h index db4bae78bda9..e3e395acc2fd 100644 --- a/include/linux/sock_diag.h +++ b/include/linux/sock_diag.h | |||
| @@ -18,6 +18,7 @@ enum { | |||
| 18 | SK_MEMINFO_FWD_ALLOC, | 18 | SK_MEMINFO_FWD_ALLOC, |
| 19 | SK_MEMINFO_WMEM_QUEUED, | 19 | SK_MEMINFO_WMEM_QUEUED, |
| 20 | SK_MEMINFO_OPTMEM, | 20 | SK_MEMINFO_OPTMEM, |
| 21 | SK_MEMINFO_BACKLOG, | ||
| 21 | 22 | ||
| 22 | SK_MEMINFO_VARS, | 23 | SK_MEMINFO_VARS, |
| 23 | }; | 24 | }; |
| @@ -43,6 +44,5 @@ void sock_diag_save_cookie(void *sk, __u32 *cookie); | |||
| 43 | 44 | ||
| 44 | int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); | 45 | int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr); |
| 45 | 46 | ||
| 46 | extern struct sock *sock_diag_nlsk; | ||
| 47 | #endif /* KERNEL */ | 47 | #endif /* KERNEL */ |
| 48 | #endif | 48 | #endif |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 25d6322fb635..ba7b2e817cfa 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -268,6 +268,7 @@ struct ucred { | |||
| 268 | #define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ | 268 | #define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */ |
| 269 | #define MSG_EOF MSG_FIN | 269 | #define MSG_EOF MSG_FIN |
| 270 | 270 | ||
| 271 | #define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */ | ||
| 271 | #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file | 272 | #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file |
| 272 | descriptor received through | 273 | descriptor received through |
| 273 | SCM_RIGHTS */ | 274 | SCM_RIGHTS */ |
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h new file mode 100644 index 000000000000..b2b1afbb3202 --- /dev/null +++ b/include/linux/spi/at86rf230.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * AT86RF230/RF231 driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009-2012 Siemens AG | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License along | ||
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 18 | * | ||
| 19 | * Written by: | ||
| 20 | * Dmitry Eremin-Solenikov <dmitry.baryshkov@siemens.com> | ||
| 21 | */ | ||
| 22 | #ifndef AT86RF230_H | ||
| 23 | #define AT86RF230_H | ||
| 24 | |||
| 25 | struct at86rf230_platform_data { | ||
| 26 | int rstn; | ||
| 27 | int slp_tr; | ||
| 28 | int dig2; | ||
| 29 | }; | ||
| 30 | |||
| 31 | #endif | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index bc14bd738ade..bb674c02f306 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -243,6 +243,7 @@ struct ssb_bus_ops { | |||
| 243 | #define SSB_DEV_MINI_MACPHY 0x823 | 243 | #define SSB_DEV_MINI_MACPHY 0x823 |
| 244 | #define SSB_DEV_ARM_1176 0x824 | 244 | #define SSB_DEV_ARM_1176 0x824 |
| 245 | #define SSB_DEV_ARM_7TDMI 0x825 | 245 | #define SSB_DEV_ARM_7TDMI 0x825 |
| 246 | #define SSB_DEV_ARM_CM3 0x82A | ||
| 246 | 247 | ||
| 247 | /* Vendor-ID values */ | 248 | /* Vendor-ID values */ |
| 248 | #define SSB_VENDOR_BROADCOM 0x4243 | 249 | #define SSB_VENDOR_BROADCOM 0x4243 |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 5f359dbfcdce..eb125a4c30b3 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -243,6 +243,16 @@ static inline unsigned int tcp_optlen(const struct sk_buff *skb) | |||
| 243 | return (tcp_hdr(skb)->doff - 5) * 4; | 243 | return (tcp_hdr(skb)->doff - 5) * 4; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | /* TCP Fast Open */ | ||
| 247 | #define TCP_FASTOPEN_COOKIE_MIN 4 /* Min Fast Open Cookie size in bytes */ | ||
| 248 | #define TCP_FASTOPEN_COOKIE_MAX 16 /* Max Fast Open Cookie size in bytes */ | ||
| 249 | |||
| 250 | /* TCP Fast Open Cookie as stored in memory */ | ||
| 251 | struct tcp_fastopen_cookie { | ||
| 252 | s8 len; | ||
| 253 | u8 val[TCP_FASTOPEN_COOKIE_MAX]; | ||
| 254 | }; | ||
| 255 | |||
| 246 | /* This defines a selective acknowledgement block. */ | 256 | /* This defines a selective acknowledgement block. */ |
| 247 | struct tcp_sack_block_wire { | 257 | struct tcp_sack_block_wire { |
| 248 | __be32 start_seq; | 258 | __be32 start_seq; |
| @@ -339,6 +349,9 @@ struct tcp_sock { | |||
| 339 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 349 | u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
| 340 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 350 | u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
| 341 | 351 | ||
| 352 | struct list_head tsq_node; /* anchor in tsq_tasklet.head list */ | ||
| 353 | unsigned long tsq_flags; | ||
| 354 | |||
| 342 | /* Data for direct copy to user */ | 355 | /* Data for direct copy to user */ |
| 343 | struct { | 356 | struct { |
| 344 | struct sk_buff_head prequeue; | 357 | struct sk_buff_head prequeue; |
| @@ -373,7 +386,9 @@ struct tcp_sock { | |||
| 373 | unused : 1; | 386 | unused : 1; |
| 374 | u8 repair_queue; | 387 | u8 repair_queue; |
| 375 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 388 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
| 376 | early_retrans_delayed:1; /* Delayed ER timer installed */ | 389 | early_retrans_delayed:1, /* Delayed ER timer installed */ |
| 390 | syn_data:1, /* SYN includes data */ | ||
| 391 | syn_fastopen:1; /* SYN includes Fast Open option */ | ||
| 377 | 392 | ||
| 378 | /* RTT measurement */ | 393 | /* RTT measurement */ |
| 379 | u32 srtt; /* smoothed round trip time << 3 */ | 394 | u32 srtt; /* smoothed round trip time << 3 */ |
| @@ -478,6 +493,9 @@ struct tcp_sock { | |||
| 478 | u32 probe_seq_start; | 493 | u32 probe_seq_start; |
| 479 | u32 probe_seq_end; | 494 | u32 probe_seq_end; |
| 480 | } mtu_probe; | 495 | } mtu_probe; |
| 496 | u32 mtu_info; /* We received an ICMP_FRAG_NEEDED / ICMPV6_PKT_TOOBIG | ||
| 497 | * while socket was owned by user. | ||
| 498 | */ | ||
| 481 | 499 | ||
| 482 | #ifdef CONFIG_TCP_MD5SIG | 500 | #ifdef CONFIG_TCP_MD5SIG |
| 483 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ | 501 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ |
| @@ -487,6 +505,9 @@ struct tcp_sock { | |||
| 487 | struct tcp_md5sig_info __rcu *md5sig_info; | 505 | struct tcp_md5sig_info __rcu *md5sig_info; |
| 488 | #endif | 506 | #endif |
| 489 | 507 | ||
| 508 | /* TCP fastopen related information */ | ||
| 509 | struct tcp_fastopen_request *fastopen_req; | ||
| 510 | |||
| 490 | /* When the cookie options are generated and exchanged, then this | 511 | /* When the cookie options are generated and exchanged, then this |
| 491 | * object holds a reference to them (cookie_values->kref). Also | 512 | * object holds a reference to them (cookie_values->kref). Also |
| 492 | * contains related tcp_cookie_transactions fields. | 513 | * contains related tcp_cookie_transactions fields. |
| @@ -494,6 +515,17 @@ struct tcp_sock { | |||
| 494 | struct tcp_cookie_values *cookie_values; | 515 | struct tcp_cookie_values *cookie_values; |
| 495 | }; | 516 | }; |
| 496 | 517 | ||
| 518 | enum tsq_flags { | ||
| 519 | TSQ_THROTTLED, | ||
| 520 | TSQ_QUEUED, | ||
| 521 | TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */ | ||
| 522 | TCP_WRITE_TIMER_DEFERRED, /* tcp_write_timer() found socket was owned */ | ||
| 523 | TCP_DELACK_TIMER_DEFERRED, /* tcp_delack_timer() found socket was owned */ | ||
| 524 | TCP_MTU_REDUCED_DEFERRED, /* tcp_v{4|6}_err() could not call | ||
| 525 | * tcp_v{4|6}_mtu_reduced() | ||
| 526 | */ | ||
| 527 | }; | ||
| 528 | |||
| 497 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 529 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
| 498 | { | 530 | { |
| 499 | return (struct tcp_sock *)sk; | 531 | return (struct tcp_sock *)sk; |
| @@ -507,7 +539,7 @@ struct tcp_timewait_sock { | |||
| 507 | u32 tw_ts_recent; | 539 | u32 tw_ts_recent; |
| 508 | long tw_ts_recent_stamp; | 540 | long tw_ts_recent_stamp; |
| 509 | #ifdef CONFIG_TCP_MD5SIG | 541 | #ifdef CONFIG_TCP_MD5SIG |
| 510 | struct tcp_md5sig_key *tw_md5_key; | 542 | struct tcp_md5sig_key *tw_md5_key; |
| 511 | #endif | 543 | #endif |
| 512 | /* Few sockets in timewait have cookies; in that case, then this | 544 | /* Few sockets in timewait have cookies; in that case, then this |
| 513 | * object holds a reference to them (tw_cookie_values->kref). | 545 | * object holds a reference to them (tw_cookie_values->kref). |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 9730b0e51e46..c98928420100 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
| @@ -102,8 +102,8 @@ | |||
| 102 | #define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */ | 102 | #define TIPC_CMD_SET_LINK_TOL 0x4107 /* tx link_config, rx none */ |
| 103 | #define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */ | 103 | #define TIPC_CMD_SET_LINK_PRI 0x4108 /* tx link_config, rx none */ |
| 104 | #define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */ | 104 | #define TIPC_CMD_SET_LINK_WINDOW 0x4109 /* tx link_config, rx none */ |
| 105 | #define TIPC_CMD_SET_LOG_SIZE 0x410A /* tx unsigned, rx none */ | 105 | #define TIPC_CMD_SET_LOG_SIZE 0x410A /* obsoleted */ |
| 106 | #define TIPC_CMD_DUMP_LOG 0x410B /* tx none, rx ultra_string */ | 106 | #define TIPC_CMD_DUMP_LOG 0x410B /* obsoleted */ |
| 107 | #define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */ | 107 | #define TIPC_CMD_RESET_LINK_STATS 0x410C /* tx link_name, rx none */ |
| 108 | 108 | ||
| 109 | /* | 109 | /* |
diff --git a/include/linux/uhid.h b/include/linux/uhid.h new file mode 100644 index 000000000000..9c6974f16966 --- /dev/null +++ b/include/linux/uhid.h | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | #ifndef __UHID_H_ | ||
| 2 | #define __UHID_H_ | ||
| 3 | |||
| 4 | /* | ||
| 5 | * User-space I/O driver support for HID subsystem | ||
| 6 | * Copyright (c) 2012 David Herrmann | ||
| 7 | */ | ||
| 8 | |||
| 9 | /* | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of the GNU General Public License as published by the Free | ||
| 12 | * Software Foundation; either version 2 of the License, or (at your option) | ||
| 13 | * any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* | ||
| 17 | * Public header for user-space communication. We try to keep every structure | ||
| 18 | * aligned but to be safe we also use __attribute__((__packed__)). Therefore, | ||
| 19 | * the communication should be ABI compatible even between architectures. | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/input.h> | ||
| 23 | #include <linux/types.h> | ||
| 24 | |||
| 25 | enum uhid_event_type { | ||
| 26 | UHID_CREATE, | ||
| 27 | UHID_DESTROY, | ||
| 28 | UHID_START, | ||
| 29 | UHID_STOP, | ||
| 30 | UHID_OPEN, | ||
| 31 | UHID_CLOSE, | ||
| 32 | UHID_OUTPUT, | ||
| 33 | UHID_OUTPUT_EV, | ||
| 34 | UHID_INPUT, | ||
| 35 | UHID_FEATURE, | ||
| 36 | UHID_FEATURE_ANSWER, | ||
| 37 | }; | ||
| 38 | |||
| 39 | struct uhid_create_req { | ||
| 40 | __u8 name[128]; | ||
| 41 | __u8 phys[64]; | ||
| 42 | __u8 uniq[64]; | ||
| 43 | __u8 __user *rd_data; | ||
| 44 | __u16 rd_size; | ||
| 45 | |||
| 46 | __u16 bus; | ||
| 47 | __u32 vendor; | ||
| 48 | __u32 product; | ||
| 49 | __u32 version; | ||
| 50 | __u32 country; | ||
| 51 | } __attribute__((__packed__)); | ||
| 52 | |||
| 53 | #define UHID_DATA_MAX 4096 | ||
| 54 | |||
| 55 | enum uhid_report_type { | ||
| 56 | UHID_FEATURE_REPORT, | ||
| 57 | UHID_OUTPUT_REPORT, | ||
| 58 | UHID_INPUT_REPORT, | ||
| 59 | }; | ||
| 60 | |||
| 61 | struct uhid_input_req { | ||
| 62 | __u8 data[UHID_DATA_MAX]; | ||
| 63 | __u16 size; | ||
| 64 | } __attribute__((__packed__)); | ||
| 65 | |||
| 66 | struct uhid_output_req { | ||
| 67 | __u8 data[UHID_DATA_MAX]; | ||
| 68 | __u16 size; | ||
| 69 | __u8 rtype; | ||
| 70 | } __attribute__((__packed__)); | ||
| 71 | |||
| 72 | struct uhid_output_ev_req { | ||
| 73 | __u16 type; | ||
| 74 | __u16 code; | ||
| 75 | __s32 value; | ||
| 76 | } __attribute__((__packed__)); | ||
| 77 | |||
| 78 | struct uhid_feature_req { | ||
| 79 | __u32 id; | ||
| 80 | __u8 rnum; | ||
| 81 | __u8 rtype; | ||
| 82 | } __attribute__((__packed__)); | ||
| 83 | |||
| 84 | struct uhid_feature_answer_req { | ||
| 85 | __u32 id; | ||
| 86 | __u16 err; | ||
| 87 | __u16 size; | ||
| 88 | __u8 data[UHID_DATA_MAX]; | ||
| 89 | }; | ||
| 90 | |||
| 91 | struct uhid_event { | ||
| 92 | __u32 type; | ||
| 93 | |||
| 94 | union { | ||
| 95 | struct uhid_create_req create; | ||
| 96 | struct uhid_input_req input; | ||
| 97 | struct uhid_output_req output; | ||
| 98 | struct uhid_output_ev_req output_ev; | ||
| 99 | struct uhid_feature_req feature; | ||
| 100 | struct uhid_feature_answer_req feature_answer; | ||
| 101 | } u; | ||
| 102 | } __attribute__((__packed__)); | ||
| 103 | |||
| 104 | #endif /* __UHID_H_ */ | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 76f439647c4b..f87cf622317f 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -66,9 +66,8 @@ struct usbnet { | |||
| 66 | # define EVENT_STS_SPLIT 3 | 66 | # define EVENT_STS_SPLIT 3 |
| 67 | # define EVENT_LINK_RESET 4 | 67 | # define EVENT_LINK_RESET 4 |
| 68 | # define EVENT_RX_PAUSED 5 | 68 | # define EVENT_RX_PAUSED 5 |
| 69 | # define EVENT_DEV_WAKING 6 | 69 | # define EVENT_DEV_ASLEEP 6 |
| 70 | # define EVENT_DEV_ASLEEP 7 | 70 | # define EVENT_DEV_OPEN 7 |
| 71 | # define EVENT_DEV_OPEN 8 | ||
| 72 | }; | 71 | }; |
| 73 | 72 | ||
| 74 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 73 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index f2b801c4b555..089a09d001d1 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -46,7 +46,8 @@ struct prefix_info { | |||
| 46 | #include <net/if_inet6.h> | 46 | #include <net/if_inet6.h> |
| 47 | #include <net/ipv6.h> | 47 | #include <net/ipv6.h> |
| 48 | 48 | ||
| 49 | #define IN6_ADDR_HSIZE 16 | 49 | #define IN6_ADDR_HSIZE_SHIFT 4 |
| 50 | #define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) | ||
| 50 | 51 | ||
| 51 | extern int addrconf_init(void); | 52 | extern int addrconf_init(void); |
| 52 | extern void addrconf_cleanup(void); | 53 | extern void addrconf_cleanup(void); |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 2ee33da36a7a..b5f8988e4283 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
| @@ -14,10 +14,11 @@ extern struct sock *unix_get_socket(struct file *filp); | |||
| 14 | extern struct sock *unix_peer_get(struct sock *); | 14 | extern struct sock *unix_peer_get(struct sock *); |
| 15 | 15 | ||
| 16 | #define UNIX_HASH_SIZE 256 | 16 | #define UNIX_HASH_SIZE 256 |
| 17 | #define UNIX_HASH_BITS 8 | ||
| 17 | 18 | ||
| 18 | extern unsigned int unix_tot_inflight; | 19 | extern unsigned int unix_tot_inflight; |
| 19 | extern spinlock_t unix_table_lock; | 20 | extern spinlock_t unix_table_lock; |
| 20 | extern struct hlist_head unix_socket_table[UNIX_HASH_SIZE + 1]; | 21 | extern struct hlist_head unix_socket_table[2 * UNIX_HASH_SIZE]; |
| 21 | 22 | ||
| 22 | struct unix_address { | 23 | struct unix_address { |
| 23 | atomic_t refcnt; | 24 | atomic_t refcnt; |
diff --git a/include/net/arp.h b/include/net/arp.h index 4a1f3fb562eb..7f7df93f37cd 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
| @@ -15,24 +15,31 @@ static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd | |||
| 15 | return val * hash_rnd; | 15 | return val * hash_rnd; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32 key) | 18 | static inline struct neighbour *__ipv4_neigh_lookup_noref(struct net_device *dev, u32 key) |
| 19 | { | 19 | { |
| 20 | struct neigh_hash_table *nht; | 20 | struct neigh_hash_table *nht = rcu_dereference_bh(arp_tbl.nht); |
| 21 | struct neighbour *n; | 21 | struct neighbour *n; |
| 22 | u32 hash_val; | 22 | u32 hash_val; |
| 23 | 23 | ||
| 24 | rcu_read_lock_bh(); | ||
| 25 | nht = rcu_dereference_bh(arp_tbl.nht); | ||
| 26 | hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift); | 24 | hash_val = arp_hashfn(key, dev, nht->hash_rnd[0]) >> (32 - nht->hash_shift); |
| 27 | for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); | 25 | for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]); |
| 28 | n != NULL; | 26 | n != NULL; |
| 29 | n = rcu_dereference_bh(n->next)) { | 27 | n = rcu_dereference_bh(n->next)) { |
| 30 | if (n->dev == dev && *(u32 *)n->primary_key == key) { | 28 | if (n->dev == dev && *(u32 *)n->primary_key == key) |
| 31 | if (!atomic_inc_not_zero(&n->refcnt)) | 29 | return n; |
| 32 | n = NULL; | ||
| 33 | break; | ||
| 34 | } | ||
| 35 | } | 30 | } |
| 31 | |||
| 32 | return NULL; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32 key) | ||
| 36 | { | ||
| 37 | struct neighbour *n; | ||
| 38 | |||
| 39 | rcu_read_lock_bh(); | ||
| 40 | n = __ipv4_neigh_lookup_noref(dev, key); | ||
| 41 | if (n && !atomic_inc_not_zero(&n->refcnt)) | ||
| 42 | n = NULL; | ||
| 36 | rcu_read_unlock_bh(); | 43 | rcu_read_unlock_bh(); |
| 37 | 44 | ||
| 38 | return n; | 45 | return n; |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h new file mode 100644 index 000000000000..6a76e0a0705e --- /dev/null +++ b/include/net/bluetooth/a2mp.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | /* | ||
| 2 | Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. | ||
| 3 | Copyright (c) 2011,2012 Intel Corp. | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License version 2 and | ||
| 7 | only version 2 as published by the Free Software Foundation. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __A2MP_H | ||
| 16 | #define __A2MP_H | ||
| 17 | |||
| 18 | #include <net/bluetooth/l2cap.h> | ||
| 19 | |||
| 20 | #define A2MP_FEAT_EXT 0x8000 | ||
| 21 | |||
| 22 | struct amp_mgr { | ||
| 23 | struct l2cap_conn *l2cap_conn; | ||
| 24 | struct l2cap_chan *a2mp_chan; | ||
| 25 | struct kref kref; | ||
| 26 | __u8 ident; | ||
| 27 | __u8 handle; | ||
| 28 | unsigned long flags; | ||
| 29 | }; | ||
| 30 | |||
| 31 | struct a2mp_cmd { | ||
| 32 | __u8 code; | ||
| 33 | __u8 ident; | ||
| 34 | __le16 len; | ||
| 35 | __u8 data[0]; | ||
| 36 | } __packed; | ||
| 37 | |||
| 38 | /* A2MP command codes */ | ||
| 39 | #define A2MP_COMMAND_REJ 0x01 | ||
| 40 | struct a2mp_cmd_rej { | ||
| 41 | __le16 reason; | ||
| 42 | __u8 data[0]; | ||
| 43 | } __packed; | ||
| 44 | |||
| 45 | #define A2MP_DISCOVER_REQ 0x02 | ||
| 46 | struct a2mp_discov_req { | ||
| 47 | __le16 mtu; | ||
| 48 | __le16 ext_feat; | ||
| 49 | } __packed; | ||
| 50 | |||
| 51 | struct a2mp_cl { | ||
| 52 | __u8 id; | ||
| 53 | __u8 type; | ||
| 54 | __u8 status; | ||
| 55 | } __packed; | ||
| 56 | |||
| 57 | #define A2MP_DISCOVER_RSP 0x03 | ||
| 58 | struct a2mp_discov_rsp { | ||
| 59 | __le16 mtu; | ||
| 60 | __le16 ext_feat; | ||
| 61 | struct a2mp_cl cl[0]; | ||
| 62 | } __packed; | ||
| 63 | |||
| 64 | #define A2MP_CHANGE_NOTIFY 0x04 | ||
| 65 | #define A2MP_CHANGE_RSP 0x05 | ||
| 66 | |||
| 67 | #define A2MP_GETINFO_REQ 0x06 | ||
| 68 | struct a2mp_info_req { | ||
| 69 | __u8 id; | ||
| 70 | } __packed; | ||
| 71 | |||
| 72 | #define A2MP_GETINFO_RSP 0x07 | ||
| 73 | struct a2mp_info_rsp { | ||
| 74 | __u8 id; | ||
| 75 | __u8 status; | ||
| 76 | __le32 total_bw; | ||
| 77 | __le32 max_bw; | ||
| 78 | __le32 min_latency; | ||
| 79 | __le16 pal_cap; | ||
| 80 | __le16 assoc_size; | ||
| 81 | } __packed; | ||
| 82 | |||
| 83 | #define A2MP_GETAMPASSOC_REQ 0x08 | ||
| 84 | struct a2mp_amp_assoc_req { | ||
| 85 | __u8 id; | ||
| 86 | } __packed; | ||
| 87 | |||
| 88 | #define A2MP_GETAMPASSOC_RSP 0x09 | ||
| 89 | struct a2mp_amp_assoc_rsp { | ||
| 90 | __u8 id; | ||
| 91 | __u8 status; | ||
| 92 | __u8 amp_assoc[0]; | ||
| 93 | } __packed; | ||
| 94 | |||
| 95 | #define A2MP_CREATEPHYSLINK_REQ 0x0A | ||
| 96 | #define A2MP_DISCONNPHYSLINK_REQ 0x0C | ||
| 97 | struct a2mp_physlink_req { | ||
| 98 | __u8 local_id; | ||
| 99 | __u8 remote_id; | ||
| 100 | __u8 amp_assoc[0]; | ||
| 101 | } __packed; | ||
| 102 | |||
| 103 | #define A2MP_CREATEPHYSLINK_RSP 0x0B | ||
| 104 | #define A2MP_DISCONNPHYSLINK_RSP 0x0D | ||
| 105 | struct a2mp_physlink_rsp { | ||
| 106 | __u8 local_id; | ||
| 107 | __u8 remote_id; | ||
| 108 | __u8 status; | ||
| 109 | } __packed; | ||
| 110 | |||
| 111 | /* A2MP response status */ | ||
| 112 | #define A2MP_STATUS_SUCCESS 0x00 | ||
| 113 | #define A2MP_STATUS_INVALID_CTRL_ID 0x01 | ||
| 114 | #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 | ||
| 115 | #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 | ||
| 116 | #define A2MP_STATUS_COLLISION_OCCURED 0x03 | ||
| 117 | #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 | ||
| 118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | ||
| 119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | ||
| 120 | |||
| 121 | void amp_mgr_get(struct amp_mgr *mgr); | ||
| 122 | int amp_mgr_put(struct amp_mgr *mgr); | ||
| 123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | ||
| 124 | struct sk_buff *skb); | ||
| 125 | |||
| 126 | #endif /* __A2MP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 961669b648fd..565d4bee1e49 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | 4 | ||
| @@ -12,22 +12,19 @@ | |||
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | 19 | ||
| 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #ifndef __BLUETOOTH_H | 25 | #ifndef __BLUETOOTH_H |
| 26 | #define __BLUETOOTH_H | 26 | #define __BLUETOOTH_H |
| 27 | 27 | ||
| 28 | #include <asm/types.h> | ||
| 29 | #include <asm/byteorder.h> | ||
| 30 | #include <linux/list.h> | ||
| 31 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
| 32 | #include <net/sock.h> | 29 | #include <net/sock.h> |
| 33 | 30 | ||
| @@ -168,8 +165,8 @@ typedef struct { | |||
| 168 | #define BDADDR_LE_PUBLIC 0x01 | 165 | #define BDADDR_LE_PUBLIC 0x01 |
| 169 | #define BDADDR_LE_RANDOM 0x02 | 166 | #define BDADDR_LE_RANDOM 0x02 |
| 170 | 167 | ||
| 171 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 168 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) |
| 172 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 169 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
| 173 | 170 | ||
| 174 | /* Copy, swap, convert BD Address */ | 171 | /* Copy, swap, convert BD Address */ |
| 175 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) | 172 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) |
| @@ -215,7 +212,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
| 215 | struct msghdr *msg, size_t len, int flags); | 212 | struct msghdr *msg, size_t len, int flags); |
| 216 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | 213 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, |
| 217 | struct msghdr *msg, size_t len, int flags); | 214 | struct msghdr *msg, size_t len, int flags); |
| 218 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 215 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); |
| 219 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 216 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 220 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 217 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 221 | 218 | ||
| @@ -225,12 +222,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
| 225 | 222 | ||
| 226 | /* Skb helpers */ | 223 | /* Skb helpers */ |
| 227 | struct l2cap_ctrl { | 224 | struct l2cap_ctrl { |
| 228 | unsigned int sframe : 1, | 225 | unsigned int sframe:1, |
| 229 | poll : 1, | 226 | poll:1, |
| 230 | final : 1, | 227 | final:1, |
| 231 | fcs : 1, | 228 | fcs:1, |
| 232 | sar : 2, | 229 | sar:2, |
| 233 | super : 2; | 230 | super:2; |
| 234 | __u16 reqseq; | 231 | __u16 reqseq; |
| 235 | __u16 txseq; | 232 | __u16 txseq; |
| 236 | __u8 retries; | 233 | __u8 retries; |
| @@ -249,7 +246,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) | |||
| 249 | { | 246 | { |
| 250 | struct sk_buff *skb; | 247 | struct sk_buff *skb; |
| 251 | 248 | ||
| 252 | if ((skb = alloc_skb(len + BT_SKB_RESERVE, how))) { | 249 | skb = alloc_skb(len + BT_SKB_RESERVE, how); |
| 250 | if (skb) { | ||
| 253 | skb_reserve(skb, BT_SKB_RESERVE); | 251 | skb_reserve(skb, BT_SKB_RESERVE); |
| 254 | bt_cb(skb)->incoming = 0; | 252 | bt_cb(skb)->incoming = 0; |
| 255 | } | 253 | } |
| @@ -261,7 +259,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, | |||
| 261 | { | 259 | { |
| 262 | struct sk_buff *skb; | 260 | struct sk_buff *skb; |
| 263 | 261 | ||
| 264 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 262 | skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); |
| 263 | if (skb) { | ||
| 265 | skb_reserve(skb, BT_SKB_RESERVE); | 264 | skb_reserve(skb, BT_SKB_RESERVE); |
| 266 | bt_cb(skb)->incoming = 0; | 265 | bt_cb(skb)->incoming = 0; |
| 267 | } | 266 | } |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 3def64ba77fa..ccd723e0f783 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -30,6 +30,9 @@ | |||
| 30 | #define HCI_MAX_EVENT_SIZE 260 | 30 | #define HCI_MAX_EVENT_SIZE 260 |
| 31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) | 31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) |
| 32 | 32 | ||
| 33 | #define HCI_LINK_KEY_SIZE 16 | ||
| 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | ||
| 35 | |||
| 33 | /* HCI dev events */ | 36 | /* HCI dev events */ |
| 34 | #define HCI_DEV_REG 1 | 37 | #define HCI_DEV_REG 1 |
| 35 | #define HCI_DEV_UNREG 2 | 38 | #define HCI_DEV_UNREG 2 |
| @@ -56,9 +59,12 @@ | |||
| 56 | #define HCI_BREDR 0x00 | 59 | #define HCI_BREDR 0x00 |
| 57 | #define HCI_AMP 0x01 | 60 | #define HCI_AMP 0x01 |
| 58 | 61 | ||
| 62 | /* First BR/EDR Controller shall have ID = 0 */ | ||
| 63 | #define HCI_BREDR_ID 0 | ||
| 64 | |||
| 59 | /* HCI device quirks */ | 65 | /* HCI device quirks */ |
| 60 | enum { | 66 | enum { |
| 61 | HCI_QUIRK_NO_RESET, | 67 | HCI_QUIRK_RESET_ON_CLOSE, |
| 62 | HCI_QUIRK_RAW_DEVICE, | 68 | HCI_QUIRK_RAW_DEVICE, |
| 63 | HCI_QUIRK_FIXUP_BUFFER_SIZE | 69 | HCI_QUIRK_FIXUP_BUFFER_SIZE |
| 64 | }; | 70 | }; |
| @@ -133,13 +139,12 @@ enum { | |||
| 133 | #define HCIINQUIRY _IOR('H', 240, int) | 139 | #define HCIINQUIRY _IOR('H', 240, int) |
| 134 | 140 | ||
| 135 | /* HCI timeouts */ | 141 | /* HCI timeouts */ |
| 136 | #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */ | 142 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| 137 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ | 143 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
| 138 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 144 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
| 139 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ | 145 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ |
| 140 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 146 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
| 141 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | 147 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
| 142 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ | ||
| 143 | 148 | ||
| 144 | /* HCI data types */ | 149 | /* HCI data types */ |
| 145 | #define HCI_COMMAND_PKT 0x01 | 150 | #define HCI_COMMAND_PKT 0x01 |
| @@ -371,7 +376,7 @@ struct hci_cp_reject_conn_req { | |||
| 371 | #define HCI_OP_LINK_KEY_REPLY 0x040b | 376 | #define HCI_OP_LINK_KEY_REPLY 0x040b |
| 372 | struct hci_cp_link_key_reply { | 377 | struct hci_cp_link_key_reply { |
| 373 | bdaddr_t bdaddr; | 378 | bdaddr_t bdaddr; |
| 374 | __u8 link_key[16]; | 379 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
| 375 | } __packed; | 380 | } __packed; |
| 376 | 381 | ||
| 377 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c | 382 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c |
| @@ -523,6 +528,28 @@ struct hci_cp_io_capability_neg_reply { | |||
| 523 | __u8 reason; | 528 | __u8 reason; |
| 524 | } __packed; | 529 | } __packed; |
| 525 | 530 | ||
| 531 | #define HCI_OP_CREATE_PHY_LINK 0x0435 | ||
| 532 | struct hci_cp_create_phy_link { | ||
| 533 | __u8 phy_handle; | ||
| 534 | __u8 key_len; | ||
| 535 | __u8 key_type; | ||
| 536 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
| 537 | } __packed; | ||
| 538 | |||
| 539 | #define HCI_OP_ACCEPT_PHY_LINK 0x0436 | ||
| 540 | struct hci_cp_accept_phy_link { | ||
| 541 | __u8 phy_handle; | ||
| 542 | __u8 key_len; | ||
| 543 | __u8 key_type; | ||
| 544 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
| 545 | } __packed; | ||
| 546 | |||
| 547 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | ||
| 548 | struct hci_cp_disconn_phy_link { | ||
| 549 | __u8 phy_handle; | ||
| 550 | __u8 reason; | ||
| 551 | } __packed; | ||
| 552 | |||
| 526 | #define HCI_OP_SNIFF_MODE 0x0803 | 553 | #define HCI_OP_SNIFF_MODE 0x0803 |
| 527 | struct hci_cp_sniff_mode { | 554 | struct hci_cp_sniff_mode { |
| 528 | __le16 handle; | 555 | __le16 handle; |
| @@ -818,6 +845,31 @@ struct hci_rp_read_local_amp_info { | |||
| 818 | __le32 be_flush_to; | 845 | __le32 be_flush_to; |
| 819 | } __packed; | 846 | } __packed; |
| 820 | 847 | ||
| 848 | #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a | ||
| 849 | struct hci_cp_read_local_amp_assoc { | ||
| 850 | __u8 phy_handle; | ||
| 851 | __le16 len_so_far; | ||
| 852 | __le16 max_len; | ||
| 853 | } __packed; | ||
| 854 | struct hci_rp_read_local_amp_assoc { | ||
| 855 | __u8 status; | ||
| 856 | __u8 phy_handle; | ||
| 857 | __le16 rem_len; | ||
| 858 | __u8 frag[0]; | ||
| 859 | } __packed; | ||
| 860 | |||
| 861 | #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b | ||
| 862 | struct hci_cp_write_remote_amp_assoc { | ||
| 863 | __u8 phy_handle; | ||
| 864 | __le16 len_so_far; | ||
| 865 | __le16 rem_len; | ||
| 866 | __u8 frag[0]; | ||
| 867 | } __packed; | ||
| 868 | struct hci_rp_write_remote_amp_assoc { | ||
| 869 | __u8 status; | ||
| 870 | __u8 phy_handle; | ||
| 871 | } __packed; | ||
| 872 | |||
| 821 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | 873 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
| 822 | struct hci_cp_le_set_event_mask { | 874 | struct hci_cp_le_set_event_mask { |
| 823 | __u8 mask[8]; | 875 | __u8 mask[8]; |
| @@ -1048,7 +1100,7 @@ struct hci_ev_link_key_req { | |||
| 1048 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 | 1100 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 |
| 1049 | struct hci_ev_link_key_notify { | 1101 | struct hci_ev_link_key_notify { |
| 1050 | bdaddr_t bdaddr; | 1102 | bdaddr_t bdaddr; |
| 1051 | __u8 link_key[16]; | 1103 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
| 1052 | __u8 key_type; | 1104 | __u8 key_type; |
| 1053 | } __packed; | 1105 | } __packed; |
| 1054 | 1106 | ||
| @@ -1196,6 +1248,39 @@ struct hci_ev_le_meta { | |||
| 1196 | __u8 subevent; | 1248 | __u8 subevent; |
| 1197 | } __packed; | 1249 | } __packed; |
| 1198 | 1250 | ||
| 1251 | #define HCI_EV_PHY_LINK_COMPLETE 0x40 | ||
| 1252 | struct hci_ev_phy_link_complete { | ||
| 1253 | __u8 status; | ||
| 1254 | __u8 phy_handle; | ||
| 1255 | } __packed; | ||
| 1256 | |||
| 1257 | #define HCI_EV_CHANNEL_SELECTED 0x41 | ||
| 1258 | struct hci_ev_channel_selected { | ||
| 1259 | __u8 phy_handle; | ||
| 1260 | } __packed; | ||
| 1261 | |||
| 1262 | #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 | ||
| 1263 | struct hci_ev_disconn_phy_link_complete { | ||
| 1264 | __u8 status; | ||
| 1265 | __u8 phy_handle; | ||
| 1266 | __u8 reason; | ||
| 1267 | } __packed; | ||
| 1268 | |||
| 1269 | #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 | ||
| 1270 | struct hci_ev_logical_link_complete { | ||
| 1271 | __u8 status; | ||
| 1272 | __le16 handle; | ||
| 1273 | __u8 phy_handle; | ||
| 1274 | __u8 flow_spec_id; | ||
| 1275 | } __packed; | ||
| 1276 | |||
| 1277 | #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 | ||
| 1278 | struct hci_ev_disconn_logical_link_complete { | ||
| 1279 | __u8 status; | ||
| 1280 | __le16 handle; | ||
| 1281 | __u8 reason; | ||
| 1282 | } __packed; | ||
| 1283 | |||
| 1199 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 | 1284 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 |
| 1200 | struct hci_comp_blocks_info { | 1285 | struct hci_comp_blocks_info { |
| 1201 | __le16 handle; | 1286 | __le16 handle; |
| @@ -1296,7 +1381,6 @@ struct hci_sco_hdr { | |||
| 1296 | __u8 dlen; | 1381 | __u8 dlen; |
| 1297 | } __packed; | 1382 | } __packed; |
| 1298 | 1383 | ||
| 1299 | #include <linux/skbuff.h> | ||
| 1300 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | 1384 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
| 1301 | { | 1385 | { |
| 1302 | return (struct hci_event_hdr *) skb->data; | 1386 | return (struct hci_event_hdr *) skb->data; |
| @@ -1313,12 +1397,12 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
| 1313 | } | 1397 | } |
| 1314 | 1398 | ||
| 1315 | /* Command opcode pack/unpack */ | 1399 | /* Command opcode pack/unpack */ |
| 1316 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1400 | #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) |
| 1317 | #define hci_opcode_ogf(op) (op >> 10) | 1401 | #define hci_opcode_ogf(op) (op >> 10) |
| 1318 | #define hci_opcode_ocf(op) (op & 0x03ff) | 1402 | #define hci_opcode_ocf(op) (op & 0x03ff) |
| 1319 | 1403 | ||
| 1320 | /* ACL handle and flags pack/unpack */ | 1404 | /* ACL handle and flags pack/unpack */ |
| 1321 | #define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12)) | 1405 | #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) |
| 1322 | #define hci_handle(h) (h & 0x0fff) | 1406 | #define hci_handle(h) (h & 0x0fff) |
| 1323 | #define hci_flags(h) (h >> 12) | 1407 | #define hci_flags(h) (h >> 12) |
| 1324 | 1408 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fc7728f94e4..475b8c04ba52 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | #ifndef __HCI_CORE_H | 25 | #ifndef __HCI_CORE_H |
| 26 | #define __HCI_CORE_H | 26 | #define __HCI_CORE_H |
| 27 | 27 | ||
| 28 | #include <linux/interrupt.h> | ||
| 29 | #include <net/bluetooth/hci.h> | 28 | #include <net/bluetooth/hci.h> |
| 30 | 29 | ||
| 31 | /* HCI priority */ | 30 | /* HCI priority */ |
| @@ -65,7 +64,7 @@ struct discovery_state { | |||
| 65 | DISCOVERY_RESOLVING, | 64 | DISCOVERY_RESOLVING, |
| 66 | DISCOVERY_STOPPING, | 65 | DISCOVERY_STOPPING, |
| 67 | } state; | 66 | } state; |
| 68 | struct list_head all; /* All devices found during inquiry */ | 67 | struct list_head all; /* All devices found during inquiry */ |
| 69 | struct list_head unknown; /* Name state not known */ | 68 | struct list_head unknown; /* Name state not known */ |
| 70 | struct list_head resolve; /* Name needs to be resolved */ | 69 | struct list_head resolve; /* Name needs to be resolved */ |
| 71 | __u32 timestamp; | 70 | __u32 timestamp; |
| @@ -105,7 +104,7 @@ struct link_key { | |||
| 105 | struct list_head list; | 104 | struct list_head list; |
| 106 | bdaddr_t bdaddr; | 105 | bdaddr_t bdaddr; |
| 107 | u8 type; | 106 | u8 type; |
| 108 | u8 val[16]; | 107 | u8 val[HCI_LINK_KEY_SIZE]; |
| 109 | u8 pin_len; | 108 | u8 pin_len; |
| 110 | }; | 109 | }; |
| 111 | 110 | ||
| @@ -333,6 +332,7 @@ struct hci_conn { | |||
| 333 | void *l2cap_data; | 332 | void *l2cap_data; |
| 334 | void *sco_data; | 333 | void *sco_data; |
| 335 | void *smp_conn; | 334 | void *smp_conn; |
| 335 | struct amp_mgr *amp_mgr; | ||
| 336 | 336 | ||
| 337 | struct hci_conn *link; | 337 | struct hci_conn *link; |
| 338 | 338 | ||
| @@ -360,7 +360,8 @@ extern int l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | |||
| 360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); |
| 361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
| 362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
| 363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); | 363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
| 364 | u16 flags); | ||
| 364 | 365 | ||
| 365 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 366 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 366 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 367 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
| @@ -429,8 +430,8 @@ enum { | |||
| 429 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 430 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
| 430 | { | 431 | { |
| 431 | struct hci_dev *hdev = conn->hdev; | 432 | struct hci_dev *hdev = conn->hdev; |
| 432 | return (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && | 433 | return test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && |
| 433 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); | 434 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
| 434 | } | 435 | } |
| 435 | 436 | ||
| 436 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 437 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
| @@ -586,18 +587,24 @@ void hci_conn_put_device(struct hci_conn *conn); | |||
| 586 | 587 | ||
| 587 | static inline void hci_conn_hold(struct hci_conn *conn) | 588 | static inline void hci_conn_hold(struct hci_conn *conn) |
| 588 | { | 589 | { |
| 590 | BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt), | ||
| 591 | atomic_read(&conn->refcnt) + 1); | ||
| 592 | |||
| 589 | atomic_inc(&conn->refcnt); | 593 | atomic_inc(&conn->refcnt); |
| 590 | cancel_delayed_work(&conn->disc_work); | 594 | cancel_delayed_work(&conn->disc_work); |
| 591 | } | 595 | } |
| 592 | 596 | ||
| 593 | static inline void hci_conn_put(struct hci_conn *conn) | 597 | static inline void hci_conn_put(struct hci_conn *conn) |
| 594 | { | 598 | { |
| 599 | BT_DBG("hcon %p refcnt %d -> %d", conn, atomic_read(&conn->refcnt), | ||
| 600 | atomic_read(&conn->refcnt) - 1); | ||
| 601 | |||
| 595 | if (atomic_dec_and_test(&conn->refcnt)) { | 602 | if (atomic_dec_and_test(&conn->refcnt)) { |
| 596 | unsigned long timeo; | 603 | unsigned long timeo; |
| 597 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 604 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { |
| 598 | del_timer(&conn->idle_timer); | 605 | del_timer(&conn->idle_timer); |
| 599 | if (conn->state == BT_CONNECTED) { | 606 | if (conn->state == BT_CONNECTED) { |
| 600 | timeo = msecs_to_jiffies(conn->disc_timeout); | 607 | timeo = conn->disc_timeout; |
| 601 | if (!conn->out) | 608 | if (!conn->out) |
| 602 | timeo *= 2; | 609 | timeo *= 2; |
| 603 | } else { | 610 | } else { |
| @@ -640,6 +647,19 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) | |||
| 640 | dev_set_drvdata(&hdev->dev, data); | 647 | dev_set_drvdata(&hdev->dev, data); |
| 641 | } | 648 | } |
| 642 | 649 | ||
| 650 | /* hci_dev_list shall be locked */ | ||
| 651 | static inline uint8_t __hci_num_ctrl(void) | ||
| 652 | { | ||
| 653 | uint8_t count = 0; | ||
| 654 | struct list_head *p; | ||
| 655 | |||
| 656 | list_for_each(p, &hci_dev_list) { | ||
| 657 | count++; | ||
| 658 | } | ||
| 659 | |||
| 660 | return count; | ||
| 661 | } | ||
| 662 | |||
| 643 | struct hci_dev *hci_dev_get(int index); | 663 | struct hci_dev *hci_dev_get(int index); |
| 644 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 664 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); |
| 645 | 665 | ||
| @@ -661,7 +681,8 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
| 661 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 681 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
| 662 | int hci_inquiry(void __user *arg); | 682 | int hci_inquiry(void __user *arg); |
| 663 | 683 | ||
| 664 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); | 684 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
| 685 | bdaddr_t *bdaddr); | ||
| 665 | int hci_blacklist_clear(struct hci_dev *hdev); | 686 | int hci_blacklist_clear(struct hci_dev *hdev); |
| 666 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 687 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
| 667 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 688 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 1c7d1cd5e679..a7679f8913d2 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -40,11 +40,11 @@ | |||
| 40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
| 41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ |
| 42 | #define L2CAP_DEFAULT_ACK_TO 200 | 42 | #define L2CAP_DEFAULT_ACK_TO 200 |
| 43 | #define L2CAP_LE_DEFAULT_MTU 23 | ||
| 44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
| 45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
| 46 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF |
| 47 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ | 46 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ |
| 47 | #define L2CAP_LE_MIN_MTU 23 | ||
| 48 | 48 | ||
| 49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) | 49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) |
| 50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) | 50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) |
| @@ -52,6 +52,8 @@ | |||
| 52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
| 53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
| 54 | 54 | ||
| 55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | ||
| 56 | |||
| 55 | /* L2CAP socket address */ | 57 | /* L2CAP socket address */ |
| 56 | struct sockaddr_l2 { | 58 | struct sockaddr_l2 { |
| 57 | sa_family_t l2_family; | 59 | sa_family_t l2_family; |
| @@ -229,9 +231,14 @@ struct l2cap_conn_rsp { | |||
| 229 | __le16 status; | 231 | __le16 status; |
| 230 | } __packed; | 232 | } __packed; |
| 231 | 233 | ||
| 234 | /* protocol/service multiplexer (PSM) */ | ||
| 235 | #define L2CAP_PSM_SDP 0x0001 | ||
| 236 | #define L2CAP_PSM_RFCOMM 0x0003 | ||
| 237 | |||
| 232 | /* channel indentifier */ | 238 | /* channel indentifier */ |
| 233 | #define L2CAP_CID_SIGNALING 0x0001 | 239 | #define L2CAP_CID_SIGNALING 0x0001 |
| 234 | #define L2CAP_CID_CONN_LESS 0x0002 | 240 | #define L2CAP_CID_CONN_LESS 0x0002 |
| 241 | #define L2CAP_CID_A2MP 0x0003 | ||
| 235 | #define L2CAP_CID_LE_DATA 0x0004 | 242 | #define L2CAP_CID_LE_DATA 0x0004 |
| 236 | #define L2CAP_CID_LE_SIGNALING 0x0005 | 243 | #define L2CAP_CID_LE_SIGNALING 0x0005 |
| 237 | #define L2CAP_CID_SMP 0x0006 | 244 | #define L2CAP_CID_SMP 0x0006 |
| @@ -271,6 +278,9 @@ struct l2cap_conf_rsp { | |||
| 271 | #define L2CAP_CONF_PENDING 0x0004 | 278 | #define L2CAP_CONF_PENDING 0x0004 |
| 272 | #define L2CAP_CONF_EFS_REJECT 0x0005 | 279 | #define L2CAP_CONF_EFS_REJECT 0x0005 |
| 273 | 280 | ||
| 281 | /* configuration req/rsp continuation flag */ | ||
| 282 | #define L2CAP_CONF_FLAG_CONTINUATION 0x0001 | ||
| 283 | |||
| 274 | struct l2cap_conf_opt { | 284 | struct l2cap_conf_opt { |
| 275 | __u8 type; | 285 | __u8 type; |
| 276 | __u8 len; | 286 | __u8 len; |
| @@ -419,11 +429,6 @@ struct l2cap_seq_list { | |||
| 419 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF | 429 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF |
| 420 | #define L2CAP_SEQ_LIST_TAIL 0x8000 | 430 | #define L2CAP_SEQ_LIST_TAIL 0x8000 |
| 421 | 431 | ||
| 422 | struct srej_list { | ||
| 423 | __u16 tx_seq; | ||
| 424 | struct list_head list; | ||
| 425 | }; | ||
| 426 | |||
| 427 | struct l2cap_chan { | 432 | struct l2cap_chan { |
| 428 | struct sock *sk; | 433 | struct sock *sk; |
| 429 | 434 | ||
| @@ -459,6 +464,7 @@ struct l2cap_chan { | |||
| 459 | 464 | ||
| 460 | __u16 tx_win; | 465 | __u16 tx_win; |
| 461 | __u16 tx_win_max; | 466 | __u16 tx_win_max; |
| 467 | __u16 ack_win; | ||
| 462 | __u8 max_tx; | 468 | __u8 max_tx; |
| 463 | __u16 retrans_timeout; | 469 | __u16 retrans_timeout; |
| 464 | __u16 monitor_timeout; | 470 | __u16 monitor_timeout; |
| @@ -475,14 +481,12 @@ struct l2cap_chan { | |||
| 475 | __u16 expected_ack_seq; | 481 | __u16 expected_ack_seq; |
| 476 | __u16 expected_tx_seq; | 482 | __u16 expected_tx_seq; |
| 477 | __u16 buffer_seq; | 483 | __u16 buffer_seq; |
| 478 | __u16 buffer_seq_srej; | ||
| 479 | __u16 srej_save_reqseq; | 484 | __u16 srej_save_reqseq; |
| 480 | __u16 last_acked_seq; | 485 | __u16 last_acked_seq; |
| 481 | __u16 frames_sent; | 486 | __u16 frames_sent; |
| 482 | __u16 unacked_frames; | 487 | __u16 unacked_frames; |
| 483 | __u8 retry_count; | 488 | __u8 retry_count; |
| 484 | __u16 srej_queue_next; | 489 | __u16 srej_queue_next; |
| 485 | __u8 num_acked; | ||
| 486 | __u16 sdu_len; | 490 | __u16 sdu_len; |
| 487 | struct sk_buff *sdu; | 491 | struct sk_buff *sdu; |
| 488 | struct sk_buff *sdu_last_frag; | 492 | struct sk_buff *sdu_last_frag; |
| @@ -515,7 +519,6 @@ struct l2cap_chan { | |||
| 515 | struct sk_buff_head srej_q; | 519 | struct sk_buff_head srej_q; |
| 516 | struct l2cap_seq_list srej_list; | 520 | struct l2cap_seq_list srej_list; |
| 517 | struct l2cap_seq_list retrans_list; | 521 | struct l2cap_seq_list retrans_list; |
| 518 | struct list_head srej_l; | ||
| 519 | 522 | ||
| 520 | struct list_head list; | 523 | struct list_head list; |
| 521 | struct list_head global_l; | 524 | struct list_head global_l; |
| @@ -528,10 +531,14 @@ struct l2cap_chan { | |||
| 528 | struct l2cap_ops { | 531 | struct l2cap_ops { |
| 529 | char *name; | 532 | char *name; |
| 530 | 533 | ||
| 531 | struct l2cap_chan *(*new_connection) (void *data); | 534 | struct l2cap_chan *(*new_connection) (struct l2cap_chan *chan); |
| 532 | int (*recv) (void *data, struct sk_buff *skb); | 535 | int (*recv) (struct l2cap_chan * chan, |
| 533 | void (*close) (void *data); | 536 | struct sk_buff *skb); |
| 534 | void (*state_change) (void *data, int state); | 537 | void (*teardown) (struct l2cap_chan *chan, int err); |
| 538 | void (*close) (struct l2cap_chan *chan); | ||
| 539 | void (*state_change) (struct l2cap_chan *chan, | ||
| 540 | int state); | ||
| 541 | void (*ready) (struct l2cap_chan *chan); | ||
| 535 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 542 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
| 536 | unsigned long len, int nb); | 543 | unsigned long len, int nb); |
| 537 | }; | 544 | }; |
| @@ -575,6 +582,7 @@ struct l2cap_conn { | |||
| 575 | #define L2CAP_CHAN_RAW 1 | 582 | #define L2CAP_CHAN_RAW 1 |
| 576 | #define L2CAP_CHAN_CONN_LESS 2 | 583 | #define L2CAP_CHAN_CONN_LESS 2 |
| 577 | #define L2CAP_CHAN_CONN_ORIENTED 3 | 584 | #define L2CAP_CHAN_CONN_ORIENTED 3 |
| 585 | #define L2CAP_CHAN_CONN_FIX_A2MP 4 | ||
| 578 | 586 | ||
| 579 | /* ----- L2CAP socket info ----- */ | 587 | /* ----- L2CAP socket info ----- */ |
| 580 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 588 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
| @@ -597,6 +605,7 @@ enum { | |||
| 597 | CONF_EWS_RECV, | 605 | CONF_EWS_RECV, |
| 598 | CONF_LOC_CONF_PEND, | 606 | CONF_LOC_CONF_PEND, |
| 599 | CONF_REM_CONF_PEND, | 607 | CONF_REM_CONF_PEND, |
| 608 | CONF_NOT_COMPLETE, | ||
| 600 | }; | 609 | }; |
| 601 | 610 | ||
| 602 | #define L2CAP_CONF_MAX_CONF_REQ 2 | 611 | #define L2CAP_CONF_MAX_CONF_REQ 2 |
| @@ -664,11 +673,15 @@ enum { | |||
| 664 | 673 | ||
| 665 | static inline void l2cap_chan_hold(struct l2cap_chan *c) | 674 | static inline void l2cap_chan_hold(struct l2cap_chan *c) |
| 666 | { | 675 | { |
| 676 | BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt)); | ||
| 677 | |||
| 667 | atomic_inc(&c->refcnt); | 678 | atomic_inc(&c->refcnt); |
| 668 | } | 679 | } |
| 669 | 680 | ||
| 670 | static inline void l2cap_chan_put(struct l2cap_chan *c) | 681 | static inline void l2cap_chan_put(struct l2cap_chan *c) |
| 671 | { | 682 | { |
| 683 | BT_DBG("chan %p orig refcnt %d", c, atomic_read(&c->refcnt)); | ||
| 684 | |||
| 672 | if (atomic_dec_and_test(&c->refcnt)) | 685 | if (atomic_dec_and_test(&c->refcnt)) |
| 673 | kfree(c); | 686 | kfree(c); |
| 674 | } | 687 | } |
| @@ -713,11 +726,7 @@ static inline bool l2cap_clear_timer(struct l2cap_chan *chan, | |||
| 713 | 726 | ||
| 714 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) | 727 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) |
| 715 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) | 728 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) |
| 716 | #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ | ||
| 717 | msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | ||
| 718 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) | 729 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) |
| 719 | #define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ | ||
| 720 | msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | ||
| 721 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) | 730 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) |
| 722 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ | 731 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ |
| 723 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | 732 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); |
| @@ -736,173 +745,17 @@ static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq) | |||
| 736 | return (seq + 1) % (chan->tx_win_max + 1); | 745 | return (seq + 1) % (chan->tx_win_max + 1); |
| 737 | } | 746 | } |
| 738 | 747 | ||
| 739 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) | 748 | static inline struct l2cap_chan *l2cap_chan_no_new_connection(struct l2cap_chan *chan) |
| 740 | { | ||
| 741 | int sub; | ||
| 742 | |||
| 743 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; | ||
| 744 | |||
| 745 | if (sub < 0) | ||
| 746 | sub += 64; | ||
| 747 | |||
| 748 | return sub == ch->remote_tx_win; | ||
| 749 | } | ||
| 750 | |||
| 751 | static inline __u16 __get_reqseq(struct l2cap_chan *chan, __u32 ctrl) | ||
| 752 | { | ||
| 753 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 754 | return (ctrl & L2CAP_EXT_CTRL_REQSEQ) >> | ||
| 755 | L2CAP_EXT_CTRL_REQSEQ_SHIFT; | ||
| 756 | else | ||
| 757 | return (ctrl & L2CAP_CTRL_REQSEQ) >> L2CAP_CTRL_REQSEQ_SHIFT; | ||
| 758 | } | ||
| 759 | |||
| 760 | static inline __u32 __set_reqseq(struct l2cap_chan *chan, __u32 reqseq) | ||
| 761 | { | ||
| 762 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 763 | return (reqseq << L2CAP_EXT_CTRL_REQSEQ_SHIFT) & | ||
| 764 | L2CAP_EXT_CTRL_REQSEQ; | ||
| 765 | else | ||
| 766 | return (reqseq << L2CAP_CTRL_REQSEQ_SHIFT) & L2CAP_CTRL_REQSEQ; | ||
| 767 | } | ||
| 768 | |||
| 769 | static inline __u16 __get_txseq(struct l2cap_chan *chan, __u32 ctrl) | ||
| 770 | { | ||
| 771 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 772 | return (ctrl & L2CAP_EXT_CTRL_TXSEQ) >> | ||
| 773 | L2CAP_EXT_CTRL_TXSEQ_SHIFT; | ||
| 774 | else | ||
| 775 | return (ctrl & L2CAP_CTRL_TXSEQ) >> L2CAP_CTRL_TXSEQ_SHIFT; | ||
| 776 | } | ||
| 777 | |||
| 778 | static inline __u32 __set_txseq(struct l2cap_chan *chan, __u32 txseq) | ||
| 779 | { | ||
| 780 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 781 | return (txseq << L2CAP_EXT_CTRL_TXSEQ_SHIFT) & | ||
| 782 | L2CAP_EXT_CTRL_TXSEQ; | ||
| 783 | else | ||
| 784 | return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; | ||
| 785 | } | ||
| 786 | |||
| 787 | static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl) | ||
| 788 | { | ||
| 789 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 790 | return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE; | ||
| 791 | else | ||
| 792 | return ctrl & L2CAP_CTRL_FRAME_TYPE; | ||
| 793 | } | ||
| 794 | |||
| 795 | static inline __u32 __set_sframe(struct l2cap_chan *chan) | ||
| 796 | { | ||
| 797 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 798 | return L2CAP_EXT_CTRL_FRAME_TYPE; | ||
| 799 | else | ||
| 800 | return L2CAP_CTRL_FRAME_TYPE; | ||
| 801 | } | ||
| 802 | |||
| 803 | static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) | ||
| 804 | { | 749 | { |
| 805 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | 750 | return NULL; |
| 806 | return (ctrl & L2CAP_EXT_CTRL_SAR) >> L2CAP_EXT_CTRL_SAR_SHIFT; | ||
| 807 | else | ||
| 808 | return (ctrl & L2CAP_CTRL_SAR) >> L2CAP_CTRL_SAR_SHIFT; | ||
| 809 | } | 751 | } |
| 810 | 752 | ||
| 811 | static inline __u32 __set_ctrl_sar(struct l2cap_chan *chan, __u32 sar) | 753 | static inline void l2cap_chan_no_teardown(struct l2cap_chan *chan, int err) |
| 812 | { | 754 | { |
| 813 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 814 | return (sar << L2CAP_EXT_CTRL_SAR_SHIFT) & L2CAP_EXT_CTRL_SAR; | ||
| 815 | else | ||
| 816 | return (sar << L2CAP_CTRL_SAR_SHIFT) & L2CAP_CTRL_SAR; | ||
| 817 | } | 755 | } |
| 818 | 756 | ||
| 819 | static inline bool __is_sar_start(struct l2cap_chan *chan, __u32 ctrl) | 757 | static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) |
| 820 | { | 758 | { |
| 821 | return __get_ctrl_sar(chan, ctrl) == L2CAP_SAR_START; | ||
| 822 | } | ||
| 823 | |||
| 824 | static inline __u32 __get_sar_mask(struct l2cap_chan *chan) | ||
| 825 | { | ||
| 826 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 827 | return L2CAP_EXT_CTRL_SAR; | ||
| 828 | else | ||
| 829 | return L2CAP_CTRL_SAR; | ||
| 830 | } | ||
| 831 | |||
| 832 | static inline __u8 __get_ctrl_super(struct l2cap_chan *chan, __u32 ctrl) | ||
| 833 | { | ||
| 834 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 835 | return (ctrl & L2CAP_EXT_CTRL_SUPERVISE) >> | ||
| 836 | L2CAP_EXT_CTRL_SUPER_SHIFT; | ||
| 837 | else | ||
| 838 | return (ctrl & L2CAP_CTRL_SUPERVISE) >> L2CAP_CTRL_SUPER_SHIFT; | ||
| 839 | } | ||
| 840 | |||
| 841 | static inline __u32 __set_ctrl_super(struct l2cap_chan *chan, __u32 super) | ||
| 842 | { | ||
| 843 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 844 | return (super << L2CAP_EXT_CTRL_SUPER_SHIFT) & | ||
| 845 | L2CAP_EXT_CTRL_SUPERVISE; | ||
| 846 | else | ||
| 847 | return (super << L2CAP_CTRL_SUPER_SHIFT) & | ||
| 848 | L2CAP_CTRL_SUPERVISE; | ||
| 849 | } | ||
| 850 | |||
| 851 | static inline __u32 __set_ctrl_final(struct l2cap_chan *chan) | ||
| 852 | { | ||
| 853 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 854 | return L2CAP_EXT_CTRL_FINAL; | ||
| 855 | else | ||
| 856 | return L2CAP_CTRL_FINAL; | ||
| 857 | } | ||
| 858 | |||
| 859 | static inline bool __is_ctrl_final(struct l2cap_chan *chan, __u32 ctrl) | ||
| 860 | { | ||
| 861 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 862 | return ctrl & L2CAP_EXT_CTRL_FINAL; | ||
| 863 | else | ||
| 864 | return ctrl & L2CAP_CTRL_FINAL; | ||
| 865 | } | ||
| 866 | |||
| 867 | static inline __u32 __set_ctrl_poll(struct l2cap_chan *chan) | ||
| 868 | { | ||
| 869 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 870 | return L2CAP_EXT_CTRL_POLL; | ||
| 871 | else | ||
| 872 | return L2CAP_CTRL_POLL; | ||
| 873 | } | ||
| 874 | |||
| 875 | static inline bool __is_ctrl_poll(struct l2cap_chan *chan, __u32 ctrl) | ||
| 876 | { | ||
| 877 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 878 | return ctrl & L2CAP_EXT_CTRL_POLL; | ||
| 879 | else | ||
| 880 | return ctrl & L2CAP_CTRL_POLL; | ||
| 881 | } | ||
| 882 | |||
| 883 | static inline __u32 __get_control(struct l2cap_chan *chan, void *p) | ||
| 884 | { | ||
| 885 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 886 | return get_unaligned_le32(p); | ||
| 887 | else | ||
| 888 | return get_unaligned_le16(p); | ||
| 889 | } | ||
| 890 | |||
| 891 | static inline void __put_control(struct l2cap_chan *chan, __u32 control, | ||
| 892 | void *p) | ||
| 893 | { | ||
| 894 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 895 | return put_unaligned_le32(control, p); | ||
| 896 | else | ||
| 897 | return put_unaligned_le16(control, p); | ||
| 898 | } | ||
| 899 | |||
| 900 | static inline __u8 __ctrl_size(struct l2cap_chan *chan) | ||
| 901 | { | ||
| 902 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
| 903 | return L2CAP_EXT_HDR_SIZE - L2CAP_HDR_SIZE; | ||
| 904 | else | ||
| 905 | return L2CAP_ENH_HDR_SIZE - L2CAP_HDR_SIZE; | ||
| 906 | } | 759 | } |
| 907 | 760 | ||
| 908 | extern bool disable_ertm; | 761 | extern bool disable_ertm; |
| @@ -926,5 +779,8 @@ int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | |||
| 926 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 779 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |
| 927 | int l2cap_chan_check_security(struct l2cap_chan *chan); | 780 | int l2cap_chan_check_security(struct l2cap_chan *chan); |
| 928 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 781 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
| 782 | int l2cap_ertm_init(struct l2cap_chan *chan); | ||
| 783 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
| 784 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | ||
| 929 | 785 | ||
| 930 | #endif /* __L2CAP_H */ | 786 | #endif /* __L2CAP_H */ |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 23fd0546fccb..4348ee8bda69 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -444,7 +444,7 @@ struct mgmt_ev_auth_failed { | |||
| 444 | struct mgmt_ev_device_found { | 444 | struct mgmt_ev_device_found { |
| 445 | struct mgmt_addr_info addr; | 445 | struct mgmt_addr_info addr; |
| 446 | __s8 rssi; | 446 | __s8 rssi; |
| 447 | __u8 flags[4]; | 447 | __le32 flags; |
| 448 | __le16 eir_len; | 448 | __le16 eir_len; |
| 449 | __u8 eir[0]; | 449 | __u8 eir[0]; |
| 450 | } __packed; | 450 | } __packed; |
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index 439dadc8102f..bcb9cc3ce98b 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
| @@ -93,25 +93,25 @@ struct cfhsi_desc { | |||
| 93 | #endif | 93 | #endif |
| 94 | 94 | ||
| 95 | /* Structure implemented by the CAIF HSI driver. */ | 95 | /* Structure implemented by the CAIF HSI driver. */ |
| 96 | struct cfhsi_drv { | 96 | struct cfhsi_cb_ops { |
| 97 | void (*tx_done_cb) (struct cfhsi_drv *drv); | 97 | void (*tx_done_cb) (struct cfhsi_cb_ops *drv); |
| 98 | void (*rx_done_cb) (struct cfhsi_drv *drv); | 98 | void (*rx_done_cb) (struct cfhsi_cb_ops *drv); |
| 99 | void (*wake_up_cb) (struct cfhsi_drv *drv); | 99 | void (*wake_up_cb) (struct cfhsi_cb_ops *drv); |
| 100 | void (*wake_down_cb) (struct cfhsi_drv *drv); | 100 | void (*wake_down_cb) (struct cfhsi_cb_ops *drv); |
| 101 | }; | 101 | }; |
| 102 | 102 | ||
| 103 | /* Structure implemented by HSI device. */ | 103 | /* Structure implemented by HSI device. */ |
| 104 | struct cfhsi_dev { | 104 | struct cfhsi_ops { |
| 105 | int (*cfhsi_up) (struct cfhsi_dev *dev); | 105 | int (*cfhsi_up) (struct cfhsi_ops *dev); |
| 106 | int (*cfhsi_down) (struct cfhsi_dev *dev); | 106 | int (*cfhsi_down) (struct cfhsi_ops *dev); |
| 107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 107 | int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
| 108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_ops *dev); |
| 109 | int (*cfhsi_wake_up) (struct cfhsi_dev *dev); | 109 | int (*cfhsi_wake_up) (struct cfhsi_ops *dev); |
| 110 | int (*cfhsi_wake_down) (struct cfhsi_dev *dev); | 110 | int (*cfhsi_wake_down) (struct cfhsi_ops *dev); |
| 111 | int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status); | 111 | int (*cfhsi_get_peer_wake) (struct cfhsi_ops *dev, bool *status); |
| 112 | int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); | 112 | int (*cfhsi_fifo_occupancy) (struct cfhsi_ops *dev, size_t *occupancy); |
| 113 | int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); | 113 | int (*cfhsi_rx_cancel)(struct cfhsi_ops *dev); |
| 114 | struct cfhsi_drv *drv; | 114 | struct cfhsi_cb_ops *cb_ops; |
| 115 | }; | 115 | }; |
| 116 | 116 | ||
| 117 | /* Structure holds status of received CAIF frames processing */ | 117 | /* Structure holds status of received CAIF frames processing */ |
| @@ -132,17 +132,26 @@ enum { | |||
| 132 | CFHSI_PRIO_LAST, | 132 | CFHSI_PRIO_LAST, |
| 133 | }; | 133 | }; |
| 134 | 134 | ||
| 135 | struct cfhsi_config { | ||
| 136 | u32 inactivity_timeout; | ||
| 137 | u32 aggregation_timeout; | ||
| 138 | u32 head_align; | ||
| 139 | u32 tail_align; | ||
| 140 | u32 q_high_mark; | ||
| 141 | u32 q_low_mark; | ||
| 142 | }; | ||
| 143 | |||
| 135 | /* Structure implemented by CAIF HSI drivers. */ | 144 | /* Structure implemented by CAIF HSI drivers. */ |
| 136 | struct cfhsi { | 145 | struct cfhsi { |
| 137 | struct caif_dev_common cfdev; | 146 | struct caif_dev_common cfdev; |
| 138 | struct net_device *ndev; | 147 | struct net_device *ndev; |
| 139 | struct platform_device *pdev; | 148 | struct platform_device *pdev; |
| 140 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; | 149 | struct sk_buff_head qhead[CFHSI_PRIO_LAST]; |
| 141 | struct cfhsi_drv drv; | 150 | struct cfhsi_cb_ops cb_ops; |
| 142 | struct cfhsi_dev *dev; | 151 | struct cfhsi_ops *ops; |
| 143 | int tx_state; | 152 | int tx_state; |
| 144 | struct cfhsi_rx_state rx_state; | 153 | struct cfhsi_rx_state rx_state; |
| 145 | unsigned long inactivity_timeout; | 154 | struct cfhsi_config cfg; |
| 146 | int rx_len; | 155 | int rx_len; |
| 147 | u8 *rx_ptr; | 156 | u8 *rx_ptr; |
| 148 | u8 *tx_buf; | 157 | u8 *tx_buf; |
| @@ -150,8 +159,6 @@ struct cfhsi { | |||
| 150 | u8 *rx_flip_buf; | 159 | u8 *rx_flip_buf; |
| 151 | spinlock_t lock; | 160 | spinlock_t lock; |
| 152 | int flow_off_sent; | 161 | int flow_off_sent; |
| 153 | u32 q_low_mark; | ||
| 154 | u32 q_high_mark; | ||
| 155 | struct list_head list; | 162 | struct list_head list; |
| 156 | struct work_struct wake_up_work; | 163 | struct work_struct wake_up_work; |
| 157 | struct work_struct wake_down_work; | 164 | struct work_struct wake_down_work; |
| @@ -164,13 +171,31 @@ struct cfhsi { | |||
| 164 | struct timer_list rx_slowpath_timer; | 171 | struct timer_list rx_slowpath_timer; |
| 165 | 172 | ||
| 166 | /* TX aggregation */ | 173 | /* TX aggregation */ |
| 167 | unsigned long aggregation_timeout; | ||
| 168 | int aggregation_len; | 174 | int aggregation_len; |
| 169 | struct timer_list aggregation_timer; | 175 | struct timer_list aggregation_timer; |
| 170 | 176 | ||
| 171 | unsigned long bits; | 177 | unsigned long bits; |
| 172 | }; | 178 | }; |
| 173 | |||
| 174 | extern struct platform_driver cfhsi_driver; | 179 | extern struct platform_driver cfhsi_driver; |
| 175 | 180 | ||
| 181 | /** | ||
| 182 | * enum ifla_caif_hsi - CAIF HSI NetlinkRT parameters. | ||
| 183 | * @IFLA_CAIF_HSI_INACTIVITY_TOUT: Inactivity timeout before | ||
| 184 | * taking the HSI wakeline down, in milliseconds. | ||
| 185 | * When using RT Netlink to create, destroy or configure a CAIF HSI interface, | ||
| 186 | * enum ifla_caif_hsi is used to specify the configuration attributes. | ||
| 187 | */ | ||
| 188 | enum ifla_caif_hsi { | ||
| 189 | __IFLA_CAIF_HSI_UNSPEC, | ||
| 190 | __IFLA_CAIF_HSI_INACTIVITY_TOUT, | ||
| 191 | __IFLA_CAIF_HSI_AGGREGATION_TOUT, | ||
| 192 | __IFLA_CAIF_HSI_HEAD_ALIGN, | ||
| 193 | __IFLA_CAIF_HSI_TAIL_ALIGN, | ||
| 194 | __IFLA_CAIF_HSI_QHIGH_WATERMARK, | ||
| 195 | __IFLA_CAIF_HSI_QLOW_WATERMARK, | ||
| 196 | __IFLA_CAIF_HSI_MAX | ||
| 197 | }; | ||
| 198 | |||
| 199 | extern struct cfhsi_ops *cfhsi_get_ops(void); | ||
| 200 | |||
| 176 | #endif /* CAIF_HSI_H_ */ | 201 | #endif /* CAIF_HSI_H_ */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0289d4ce7070..493fa0c79005 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -70,11 +70,13 @@ | |||
| 70 | * | 70 | * |
| 71 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band | 71 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band |
| 72 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) | 72 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) |
| 73 | * @IEEE80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) | ||
| 73 | * @IEEE80211_NUM_BANDS: number of defined bands | 74 | * @IEEE80211_NUM_BANDS: number of defined bands |
| 74 | */ | 75 | */ |
| 75 | enum ieee80211_band { | 76 | enum ieee80211_band { |
| 76 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, | 77 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, |
| 77 | IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, | 78 | IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ, |
| 79 | IEEE80211_BAND_60GHZ = NL80211_BAND_60GHZ, | ||
| 78 | 80 | ||
| 79 | /* keep last */ | 81 | /* keep last */ |
| 80 | IEEE80211_NUM_BANDS | 82 | IEEE80211_NUM_BANDS |
| @@ -211,6 +213,22 @@ struct ieee80211_sta_ht_cap { | |||
| 211 | }; | 213 | }; |
| 212 | 214 | ||
| 213 | /** | 215 | /** |
| 216 | * struct ieee80211_sta_vht_cap - STA's VHT capabilities | ||
| 217 | * | ||
| 218 | * This structure describes most essential parameters needed | ||
| 219 | * to describe 802.11ac VHT capabilities for an STA. | ||
| 220 | * | ||
| 221 | * @vht_supported: is VHT supported by the STA | ||
| 222 | * @cap: VHT capabilities map as described in 802.11ac spec | ||
| 223 | * @vht_mcs: Supported VHT MCS rates | ||
| 224 | */ | ||
| 225 | struct ieee80211_sta_vht_cap { | ||
| 226 | bool vht_supported; | ||
| 227 | u32 cap; /* use IEEE80211_VHT_CAP_ */ | ||
| 228 | struct ieee80211_vht_mcs_info vht_mcs; | ||
| 229 | }; | ||
| 230 | |||
| 231 | /** | ||
| 214 | * struct ieee80211_supported_band - frequency band definition | 232 | * struct ieee80211_supported_band - frequency band definition |
| 215 | * | 233 | * |
| 216 | * This structure describes a frequency band a wiphy | 234 | * This structure describes a frequency band a wiphy |
| @@ -233,6 +251,7 @@ struct ieee80211_supported_band { | |||
| 233 | int n_channels; | 251 | int n_channels; |
| 234 | int n_bitrates; | 252 | int n_bitrates; |
| 235 | struct ieee80211_sta_ht_cap ht_cap; | 253 | struct ieee80211_sta_ht_cap ht_cap; |
| 254 | struct ieee80211_sta_vht_cap vht_cap; | ||
| 236 | }; | 255 | }; |
| 237 | 256 | ||
| 238 | /* | 257 | /* |
| @@ -404,6 +423,8 @@ struct cfg80211_beacon_data { | |||
| 404 | * | 423 | * |
| 405 | * Used to configure an AP interface. | 424 | * Used to configure an AP interface. |
| 406 | * | 425 | * |
| 426 | * @channel: the channel to start the AP on | ||
| 427 | * @channel_type: the channel type to use | ||
| 407 | * @beacon: beacon data | 428 | * @beacon: beacon data |
| 408 | * @beacon_interval: beacon interval | 429 | * @beacon_interval: beacon interval |
| 409 | * @dtim_period: DTIM period | 430 | * @dtim_period: DTIM period |
| @@ -417,6 +438,9 @@ struct cfg80211_beacon_data { | |||
| 417 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 438 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
| 418 | */ | 439 | */ |
| 419 | struct cfg80211_ap_settings { | 440 | struct cfg80211_ap_settings { |
| 441 | struct ieee80211_channel *channel; | ||
| 442 | enum nl80211_channel_type channel_type; | ||
| 443 | |||
| 420 | struct cfg80211_beacon_data beacon; | 444 | struct cfg80211_beacon_data beacon; |
| 421 | 445 | ||
| 422 | int beacon_interval, dtim_period; | 446 | int beacon_interval, dtim_period; |
| @@ -556,11 +580,13 @@ enum station_info_flags { | |||
| 556 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 580 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled |
| 557 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission | 581 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission |
| 558 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 582 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
| 583 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | ||
| 559 | */ | 584 | */ |
| 560 | enum rate_info_flags { | 585 | enum rate_info_flags { |
| 561 | RATE_INFO_FLAGS_MCS = 1<<0, | 586 | RATE_INFO_FLAGS_MCS = 1<<0, |
| 562 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 587 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, |
| 563 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 588 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, |
| 589 | RATE_INFO_FLAGS_60G = 1<<3, | ||
| 564 | }; | 590 | }; |
| 565 | 591 | ||
| 566 | /** | 592 | /** |
| @@ -622,10 +648,10 @@ struct sta_bss_parameters { | |||
| 622 | * @llid: mesh local link id | 648 | * @llid: mesh local link id |
| 623 | * @plid: mesh peer link id | 649 | * @plid: mesh peer link id |
| 624 | * @plink_state: mesh peer link state | 650 | * @plink_state: mesh peer link state |
| 625 | * @signal: the signal strength, type depends on the wiphy's signal_type | 651 | * @signal: The signal strength, type depends on the wiphy's signal_type. |
| 626 | NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. | 652 | * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. |
| 627 | * @signal_avg: avg signal strength, type depends on the wiphy's signal_type | 653 | * @signal_avg: Average signal strength, type depends on the wiphy's signal_type. |
| 628 | NOTE: For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. | 654 | * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. |
| 629 | * @txrate: current unicast bitrate from this station | 655 | * @txrate: current unicast bitrate from this station |
| 630 | * @rxrate: current unicast bitrate to this station | 656 | * @rxrate: current unicast bitrate to this station |
| 631 | * @rx_packets: packets received from this station | 657 | * @rx_packets: packets received from this station |
| @@ -785,47 +811,101 @@ struct bss_parameters { | |||
| 785 | int ht_opmode; | 811 | int ht_opmode; |
| 786 | }; | 812 | }; |
| 787 | 813 | ||
| 788 | /* | 814 | /** |
| 789 | * struct mesh_config - 802.11s mesh configuration | 815 | * struct mesh_config - 802.11s mesh configuration |
| 790 | * | 816 | * |
| 791 | * These parameters can be changed while the mesh is active. | 817 | * These parameters can be changed while the mesh is active. |
| 818 | * | ||
| 819 | * @dot11MeshRetryTimeout: the initial retry timeout in millisecond units used | ||
| 820 | * by the Mesh Peering Open message | ||
| 821 | * @dot11MeshConfirmTimeout: the initial retry timeout in millisecond units | ||
| 822 | * used by the Mesh Peering Open message | ||
| 823 | * @dot11MeshHoldingTimeout: the confirm timeout in millisecond units used by | ||
| 824 | * the mesh peering management to close a mesh peering | ||
| 825 | * @dot11MeshMaxPeerLinks: the maximum number of peer links allowed on this | ||
| 826 | * mesh interface | ||
| 827 | * @dot11MeshMaxRetries: the maximum number of peer link open retries that can | ||
| 828 | * be sent to establish a new peer link instance in a mesh | ||
| 829 | * @dot11MeshTTL: the value of TTL field set at a source mesh STA | ||
| 830 | * @element_ttl: the value of TTL field set at a mesh STA for path selection | ||
| 831 | * elements | ||
| 832 | * @auto_open_plinks: whether we should automatically open peer links when we | ||
| 833 | * detect compatible mesh peers | ||
| 834 | * @dot11MeshNbrOffsetMaxNeighbor: the maximum number of neighbors to | ||
| 835 | * synchronize to for 11s default synchronization method | ||
| 836 | * @dot11MeshHWMPmaxPREQretries: the number of action frames containing a PREQ | ||
| 837 | * that an originator mesh STA can send to a particular path target | ||
| 838 | * @path_refresh_time: how frequently to refresh mesh paths in milliseconds | ||
| 839 | * @min_discovery_timeout: the minimum length of time to wait until giving up on | ||
| 840 | * a path discovery in milliseconds | ||
| 841 | * @dot11MeshHWMPactivePathTimeout: the time (in TUs) for which mesh STAs | ||
| 842 | * receiving a PREQ shall consider the forwarding information from the | ||
| 843 | * root to be valid. (TU = time unit) | ||
| 844 | * @dot11MeshHWMPpreqMinInterval: the minimum interval of time (in TUs) during | ||
| 845 | * which a mesh STA can send only one action frame containing a PREQ | ||
| 846 | * element | ||
| 847 | * @dot11MeshHWMPperrMinInterval: the minimum interval of time (in TUs) during | ||
| 848 | * which a mesh STA can send only one Action frame containing a PERR | ||
| 849 | * element | ||
| 850 | * @dot11MeshHWMPnetDiameterTraversalTime: the interval of time (in TUs) that | ||
| 851 | * it takes for an HWMP information element to propagate across the mesh | ||
| 852 | * @dot11MeshHWMPRootMode: the configuration of a mesh STA as root mesh STA | ||
| 853 | * @dot11MeshHWMPRannInterval: the interval of time (in TUs) between root | ||
| 854 | * announcements are transmitted | ||
| 855 | * @dot11MeshGateAnnouncementProtocol: whether to advertise that this mesh | ||
| 856 | * station has access to a broader network beyond the MBSS. (This is | ||
| 857 | * missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol set to true | ||
| 858 | * only means that the station will announce others it's a mesh gate, but | ||
| 859 | * not necessarily using the gate announcement protocol. Still keeping the | ||
| 860 | * same nomenclature to be in sync with the spec) | ||
| 861 | * @dot11MeshForwarding: whether the Mesh STA is forwarding or non-forwarding | ||
| 862 | * entity (default is TRUE - forwarding entity) | ||
| 863 | * @rssi_threshold: the threshold for average signal strength of candidate | ||
| 864 | * station to establish a peer link | ||
| 865 | * @ht_opmode: mesh HT protection mode | ||
| 866 | * | ||
| 867 | * @dot11MeshHWMPactivePathToRootTimeout: The time (in TUs) for which mesh STAs | ||
| 868 | * receiving a proactive PREQ shall consider the forwarding information to | ||
| 869 | * the root mesh STA to be valid. | ||
| 870 | * | ||
| 871 | * @dot11MeshHWMProotInterval: The interval of time (in TUs) between proactive | ||
| 872 | * PREQs are transmitted. | ||
| 873 | * @dot11MeshHWMPconfirmationInterval: The minimum interval of time (in TUs) | ||
| 874 | * during which a mesh STA can send only one Action frame containing | ||
| 875 | * a PREQ element for root path confirmation. | ||
| 792 | */ | 876 | */ |
| 793 | struct mesh_config { | 877 | struct mesh_config { |
| 794 | /* Timeouts in ms */ | ||
| 795 | /* Mesh plink management parameters */ | ||
| 796 | u16 dot11MeshRetryTimeout; | 878 | u16 dot11MeshRetryTimeout; |
| 797 | u16 dot11MeshConfirmTimeout; | 879 | u16 dot11MeshConfirmTimeout; |
| 798 | u16 dot11MeshHoldingTimeout; | 880 | u16 dot11MeshHoldingTimeout; |
| 799 | u16 dot11MeshMaxPeerLinks; | 881 | u16 dot11MeshMaxPeerLinks; |
| 800 | u8 dot11MeshMaxRetries; | 882 | u8 dot11MeshMaxRetries; |
| 801 | u8 dot11MeshTTL; | 883 | u8 dot11MeshTTL; |
| 802 | /* ttl used in path selection information elements */ | 884 | u8 element_ttl; |
| 803 | u8 element_ttl; | ||
| 804 | bool auto_open_plinks; | 885 | bool auto_open_plinks; |
| 805 | /* neighbor offset synchronization */ | ||
| 806 | u32 dot11MeshNbrOffsetMaxNeighbor; | 886 | u32 dot11MeshNbrOffsetMaxNeighbor; |
| 807 | /* HWMP parameters */ | 887 | u8 dot11MeshHWMPmaxPREQretries; |
| 808 | u8 dot11MeshHWMPmaxPREQretries; | ||
| 809 | u32 path_refresh_time; | 888 | u32 path_refresh_time; |
| 810 | u16 min_discovery_timeout; | 889 | u16 min_discovery_timeout; |
| 811 | u32 dot11MeshHWMPactivePathTimeout; | 890 | u32 dot11MeshHWMPactivePathTimeout; |
| 812 | u16 dot11MeshHWMPpreqMinInterval; | 891 | u16 dot11MeshHWMPpreqMinInterval; |
| 813 | u16 dot11MeshHWMPperrMinInterval; | 892 | u16 dot11MeshHWMPperrMinInterval; |
| 814 | u16 dot11MeshHWMPnetDiameterTraversalTime; | 893 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
| 815 | u8 dot11MeshHWMPRootMode; | 894 | u8 dot11MeshHWMPRootMode; |
| 816 | u16 dot11MeshHWMPRannInterval; | 895 | u16 dot11MeshHWMPRannInterval; |
| 817 | /* This is missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol | 896 | bool dot11MeshGateAnnouncementProtocol; |
| 818 | * set to true only means that the station will announce others it's a | ||
| 819 | * mesh gate, but not necessarily using the gate announcement protocol. | ||
| 820 | * Still keeping the same nomenclature to be in sync with the spec. */ | ||
| 821 | bool dot11MeshGateAnnouncementProtocol; | ||
| 822 | bool dot11MeshForwarding; | 897 | bool dot11MeshForwarding; |
| 823 | s32 rssi_threshold; | 898 | s32 rssi_threshold; |
| 824 | u16 ht_opmode; | 899 | u16 ht_opmode; |
| 900 | u32 dot11MeshHWMPactivePathToRootTimeout; | ||
| 901 | u16 dot11MeshHWMProotInterval; | ||
| 902 | u16 dot11MeshHWMPconfirmationInterval; | ||
| 825 | }; | 903 | }; |
| 826 | 904 | ||
| 827 | /** | 905 | /** |
| 828 | * struct mesh_setup - 802.11s mesh setup configuration | 906 | * struct mesh_setup - 802.11s mesh setup configuration |
| 907 | * @channel: the channel to start the mesh network on | ||
| 908 | * @channel_type: the channel type to use | ||
| 829 | * @mesh_id: the mesh ID | 909 | * @mesh_id: the mesh ID |
| 830 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 910 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
| 831 | * @sync_method: which synchronization method to use | 911 | * @sync_method: which synchronization method to use |
| @@ -840,6 +920,8 @@ struct mesh_config { | |||
| 840 | * These parameters are fixed when the mesh is created. | 920 | * These parameters are fixed when the mesh is created. |
| 841 | */ | 921 | */ |
| 842 | struct mesh_setup { | 922 | struct mesh_setup { |
| 923 | struct ieee80211_channel *channel; | ||
| 924 | enum nl80211_channel_type channel_type; | ||
| 843 | const u8 *mesh_id; | 925 | const u8 *mesh_id; |
| 844 | u8 mesh_id_len; | 926 | u8 mesh_id_len; |
| 845 | u8 sync_method; | 927 | u8 sync_method; |
| @@ -917,7 +999,7 @@ struct cfg80211_ssid { | |||
| 917 | * @ie_len: length of ie in octets | 999 | * @ie_len: length of ie in octets |
| 918 | * @rates: bitmap of rates to advertise for each band | 1000 | * @rates: bitmap of rates to advertise for each band |
| 919 | * @wiphy: the wiphy this was for | 1001 | * @wiphy: the wiphy this was for |
| 920 | * @dev: the interface | 1002 | * @wdev: the wireless device to scan for |
| 921 | * @aborted: (internal) scan request was notified as aborted | 1003 | * @aborted: (internal) scan request was notified as aborted |
| 922 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | 1004 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band |
| 923 | */ | 1005 | */ |
| @@ -930,9 +1012,10 @@ struct cfg80211_scan_request { | |||
| 930 | 1012 | ||
| 931 | u32 rates[IEEE80211_NUM_BANDS]; | 1013 | u32 rates[IEEE80211_NUM_BANDS]; |
| 932 | 1014 | ||
| 1015 | struct wireless_dev *wdev; | ||
| 1016 | |||
| 933 | /* internal */ | 1017 | /* internal */ |
| 934 | struct wiphy *wiphy; | 1018 | struct wiphy *wiphy; |
| 935 | struct net_device *dev; | ||
| 936 | bool aborted; | 1019 | bool aborted; |
| 937 | bool no_cck; | 1020 | bool no_cck; |
| 938 | 1021 | ||
| @@ -966,6 +1049,7 @@ struct cfg80211_match_set { | |||
| 966 | * @wiphy: the wiphy this was for | 1049 | * @wiphy: the wiphy this was for |
| 967 | * @dev: the interface | 1050 | * @dev: the interface |
| 968 | * @channels: channels to scan | 1051 | * @channels: channels to scan |
| 1052 | * @rssi_thold: don't report scan results below this threshold (in s32 dBm) | ||
| 969 | */ | 1053 | */ |
| 970 | struct cfg80211_sched_scan_request { | 1054 | struct cfg80211_sched_scan_request { |
| 971 | struct cfg80211_ssid *ssids; | 1055 | struct cfg80211_ssid *ssids; |
| @@ -976,6 +1060,7 @@ struct cfg80211_sched_scan_request { | |||
| 976 | size_t ie_len; | 1060 | size_t ie_len; |
| 977 | struct cfg80211_match_set *match_sets; | 1061 | struct cfg80211_match_set *match_sets; |
| 978 | int n_match_sets; | 1062 | int n_match_sets; |
| 1063 | s32 rssi_thold; | ||
| 979 | 1064 | ||
| 980 | /* internal */ | 1065 | /* internal */ |
| 981 | struct wiphy *wiphy; | 1066 | struct wiphy *wiphy; |
| @@ -1351,10 +1436,10 @@ struct cfg80211_gtk_rekey_data { | |||
| 1351 | * | 1436 | * |
| 1352 | * @add_virtual_intf: create a new virtual interface with the given name, | 1437 | * @add_virtual_intf: create a new virtual interface with the given name, |
| 1353 | * must set the struct wireless_dev's iftype. Beware: You must create | 1438 | * must set the struct wireless_dev's iftype. Beware: You must create |
| 1354 | * the new netdev in the wiphy's network namespace! Returns the netdev, | 1439 | * the new netdev in the wiphy's network namespace! Returns the struct |
| 1355 | * or an ERR_PTR. | 1440 | * wireless_dev, or an ERR_PTR. |
| 1356 | * | 1441 | * |
| 1357 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 1442 | * @del_virtual_intf: remove the virtual interface |
| 1358 | * | 1443 | * |
| 1359 | * @change_virtual_intf: change type/configuration of virtual interface, | 1444 | * @change_virtual_intf: change type/configuration of virtual interface, |
| 1360 | * keep the struct wireless_dev's iftype updated. | 1445 | * keep the struct wireless_dev's iftype updated. |
| @@ -1411,14 +1496,14 @@ struct cfg80211_gtk_rekey_data { | |||
| 1411 | * | 1496 | * |
| 1412 | * @set_txq_params: Set TX queue parameters | 1497 | * @set_txq_params: Set TX queue parameters |
| 1413 | * | 1498 | * |
| 1414 | * @set_channel: Set channel for a given wireless interface. Some devices | 1499 | * @libertas_set_mesh_channel: Only for backward compatibility for libertas, |
| 1415 | * may support multi-channel operation (by channel hopping) so cfg80211 | 1500 | * as it doesn't implement join_mesh and needs to set the channel to |
| 1416 | * doesn't verify much. Note, however, that the passed netdev may be | 1501 | * join the mesh instead. |
| 1417 | * %NULL as well if the user requested changing the channel for the | 1502 | * |
| 1418 | * device itself, or for a monitor interface. | 1503 | * @set_monitor_channel: Set the monitor mode channel for the device. If other |
| 1419 | * @get_channel: Get the current operating channel, should return %NULL if | 1504 | * interfaces are active this callback should reject the configuration. |
| 1420 | * there's no single defined operating channel if for example the | 1505 | * If no interfaces are active or the device is down, the channel should |
| 1421 | * device implements channel hopping for multi-channel virtual interfaces. | 1506 | * be stored for when a monitor interface becomes active. |
| 1422 | * | 1507 | * |
| 1423 | * @scan: Request to do a scan. If returning zero, the scan request is given | 1508 | * @scan: Request to do a scan. If returning zero, the scan request is given |
| 1424 | * the driver, and will be valid until passed to cfg80211_scan_done(). | 1509 | * the driver, and will be valid until passed to cfg80211_scan_done(). |
| @@ -1488,6 +1573,8 @@ struct cfg80211_gtk_rekey_data { | |||
| 1488 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 | 1573 | * @set_power_mgmt: Configure WLAN power management. A timeout value of -1 |
| 1489 | * allows the driver to adjust the dynamic ps timeout value. | 1574 | * allows the driver to adjust the dynamic ps timeout value. |
| 1490 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | 1575 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. |
| 1576 | * @set_cqm_txe_config: Configure connection quality monitor TX error | ||
| 1577 | * thresholds. | ||
| 1491 | * @sched_scan_start: Tell the driver to start a scheduled scan. | 1578 | * @sched_scan_start: Tell the driver to start a scheduled scan. |
| 1492 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled | 1579 | * @sched_scan_stop: Tell the driver to stop an ongoing scheduled |
| 1493 | * scan. The driver_initiated flag specifies whether the driver | 1580 | * scan. The driver_initiated flag specifies whether the driver |
| @@ -1525,18 +1612,23 @@ struct cfg80211_gtk_rekey_data { | |||
| 1525 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | 1612 | * @get_et_strings: Ethtool API to get a set of strings to describe stats |
| 1526 | * and perhaps other supported types of ethtool data-sets. | 1613 | * and perhaps other supported types of ethtool data-sets. |
| 1527 | * See @ethtool_ops.get_strings | 1614 | * See @ethtool_ops.get_strings |
| 1615 | * | ||
| 1616 | * @get_channel: Get the current operating channel for the virtual interface. | ||
| 1617 | * For monitor interfaces, it should return %NULL unless there's a single | ||
| 1618 | * current monitoring channel. | ||
| 1528 | */ | 1619 | */ |
| 1529 | struct cfg80211_ops { | 1620 | struct cfg80211_ops { |
| 1530 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1621 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
| 1531 | int (*resume)(struct wiphy *wiphy); | 1622 | int (*resume)(struct wiphy *wiphy); |
| 1532 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); | 1623 | void (*set_wakeup)(struct wiphy *wiphy, bool enabled); |
| 1533 | 1624 | ||
| 1534 | struct net_device * (*add_virtual_intf)(struct wiphy *wiphy, | 1625 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, |
| 1535 | char *name, | 1626 | char *name, |
| 1536 | enum nl80211_iftype type, | 1627 | enum nl80211_iftype type, |
| 1537 | u32 *flags, | 1628 | u32 *flags, |
| 1538 | struct vif_params *params); | 1629 | struct vif_params *params); |
| 1539 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); | 1630 | int (*del_virtual_intf)(struct wiphy *wiphy, |
| 1631 | struct wireless_dev *wdev); | ||
| 1540 | int (*change_virtual_intf)(struct wiphy *wiphy, | 1632 | int (*change_virtual_intf)(struct wiphy *wiphy, |
| 1541 | struct net_device *dev, | 1633 | struct net_device *dev, |
| 1542 | enum nl80211_iftype type, u32 *flags, | 1634 | enum nl80211_iftype type, u32 *flags, |
| @@ -1605,11 +1697,15 @@ struct cfg80211_ops { | |||
| 1605 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, | 1697 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, |
| 1606 | struct ieee80211_txq_params *params); | 1698 | struct ieee80211_txq_params *params); |
| 1607 | 1699 | ||
| 1608 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, | 1700 | int (*libertas_set_mesh_channel)(struct wiphy *wiphy, |
| 1609 | struct ieee80211_channel *chan, | 1701 | struct net_device *dev, |
| 1610 | enum nl80211_channel_type channel_type); | 1702 | struct ieee80211_channel *chan); |
| 1703 | |||
| 1704 | int (*set_monitor_channel)(struct wiphy *wiphy, | ||
| 1705 | struct ieee80211_channel *chan, | ||
| 1706 | enum nl80211_channel_type channel_type); | ||
| 1611 | 1707 | ||
| 1612 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, | 1708 | int (*scan)(struct wiphy *wiphy, |
| 1613 | struct cfg80211_scan_request *request); | 1709 | struct cfg80211_scan_request *request); |
| 1614 | 1710 | ||
| 1615 | int (*auth)(struct wiphy *wiphy, struct net_device *dev, | 1711 | int (*auth)(struct wiphy *wiphy, struct net_device *dev, |
| @@ -1663,23 +1759,23 @@ struct cfg80211_ops { | |||
| 1663 | int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); | 1759 | int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); |
| 1664 | 1760 | ||
| 1665 | int (*remain_on_channel)(struct wiphy *wiphy, | 1761 | int (*remain_on_channel)(struct wiphy *wiphy, |
| 1666 | struct net_device *dev, | 1762 | struct wireless_dev *wdev, |
| 1667 | struct ieee80211_channel *chan, | 1763 | struct ieee80211_channel *chan, |
| 1668 | enum nl80211_channel_type channel_type, | 1764 | enum nl80211_channel_type channel_type, |
| 1669 | unsigned int duration, | 1765 | unsigned int duration, |
| 1670 | u64 *cookie); | 1766 | u64 *cookie); |
| 1671 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1767 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
| 1672 | struct net_device *dev, | 1768 | struct wireless_dev *wdev, |
| 1673 | u64 cookie); | 1769 | u64 cookie); |
| 1674 | 1770 | ||
| 1675 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, | 1771 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 1676 | struct ieee80211_channel *chan, bool offchan, | 1772 | struct ieee80211_channel *chan, bool offchan, |
| 1677 | enum nl80211_channel_type channel_type, | 1773 | enum nl80211_channel_type channel_type, |
| 1678 | bool channel_type_valid, unsigned int wait, | 1774 | bool channel_type_valid, unsigned int wait, |
| 1679 | const u8 *buf, size_t len, bool no_cck, | 1775 | const u8 *buf, size_t len, bool no_cck, |
| 1680 | bool dont_wait_for_ack, u64 *cookie); | 1776 | bool dont_wait_for_ack, u64 *cookie); |
| 1681 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1777 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
| 1682 | struct net_device *dev, | 1778 | struct wireless_dev *wdev, |
| 1683 | u64 cookie); | 1779 | u64 cookie); |
| 1684 | 1780 | ||
| 1685 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1781 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
| @@ -1689,8 +1785,12 @@ struct cfg80211_ops { | |||
| 1689 | struct net_device *dev, | 1785 | struct net_device *dev, |
| 1690 | s32 rssi_thold, u32 rssi_hyst); | 1786 | s32 rssi_thold, u32 rssi_hyst); |
| 1691 | 1787 | ||
| 1788 | int (*set_cqm_txe_config)(struct wiphy *wiphy, | ||
| 1789 | struct net_device *dev, | ||
| 1790 | u32 rate, u32 pkts, u32 intvl); | ||
| 1791 | |||
| 1692 | void (*mgmt_frame_register)(struct wiphy *wiphy, | 1792 | void (*mgmt_frame_register)(struct wiphy *wiphy, |
| 1693 | struct net_device *dev, | 1793 | struct wireless_dev *wdev, |
| 1694 | u16 frame_type, bool reg); | 1794 | u16 frame_type, bool reg); |
| 1695 | 1795 | ||
| 1696 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); | 1796 | int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant); |
| @@ -1721,15 +1821,17 @@ struct cfg80211_ops { | |||
| 1721 | struct net_device *dev, | 1821 | struct net_device *dev, |
| 1722 | u16 noack_map); | 1822 | u16 noack_map); |
| 1723 | 1823 | ||
| 1724 | struct ieee80211_channel *(*get_channel)(struct wiphy *wiphy, | ||
| 1725 | enum nl80211_channel_type *type); | ||
| 1726 | |||
| 1727 | int (*get_et_sset_count)(struct wiphy *wiphy, | 1824 | int (*get_et_sset_count)(struct wiphy *wiphy, |
| 1728 | struct net_device *dev, int sset); | 1825 | struct net_device *dev, int sset); |
| 1729 | void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, | 1826 | void (*get_et_stats)(struct wiphy *wiphy, struct net_device *dev, |
| 1730 | struct ethtool_stats *stats, u64 *data); | 1827 | struct ethtool_stats *stats, u64 *data); |
| 1731 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1828 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
| 1732 | u32 sset, u8 *data); | 1829 | u32 sset, u8 *data); |
| 1830 | |||
| 1831 | struct ieee80211_channel * | ||
| 1832 | (*get_channel)(struct wiphy *wiphy, | ||
| 1833 | struct wireless_dev *wdev, | ||
| 1834 | enum nl80211_channel_type *type); | ||
| 1733 | }; | 1835 | }; |
| 1734 | 1836 | ||
| 1735 | /* | 1837 | /* |
| @@ -2083,7 +2185,9 @@ struct wiphy { | |||
| 2083 | char fw_version[ETHTOOL_BUSINFO_LEN]; | 2185 | char fw_version[ETHTOOL_BUSINFO_LEN]; |
| 2084 | u32 hw_version; | 2186 | u32 hw_version; |
| 2085 | 2187 | ||
| 2188 | #ifdef CONFIG_PM | ||
| 2086 | struct wiphy_wowlan_support wowlan; | 2189 | struct wiphy_wowlan_support wowlan; |
| 2190 | #endif | ||
| 2087 | 2191 | ||
| 2088 | u16 max_remain_on_channel_duration; | 2192 | u16 max_remain_on_channel_duration; |
| 2089 | 2193 | ||
| @@ -2250,20 +2354,31 @@ struct cfg80211_internal_bss; | |||
| 2250 | struct cfg80211_cached_keys; | 2354 | struct cfg80211_cached_keys; |
| 2251 | 2355 | ||
| 2252 | /** | 2356 | /** |
| 2253 | * struct wireless_dev - wireless per-netdev state | 2357 | * struct wireless_dev - wireless device state |
| 2358 | * | ||
| 2359 | * For netdevs, this structure must be allocated by the driver | ||
| 2360 | * that uses the ieee80211_ptr field in struct net_device (this | ||
| 2361 | * is intentional so it can be allocated along with the netdev.) | ||
| 2362 | * It need not be registered then as netdev registration will | ||
| 2363 | * be intercepted by cfg80211 to see the new wireless device. | ||
| 2254 | * | 2364 | * |
| 2255 | * This structure must be allocated by the driver/stack | 2365 | * For non-netdev uses, it must also be allocated by the driver |
| 2256 | * that uses the ieee80211_ptr field in struct net_device | 2366 | * in response to the cfg80211 callbacks that require it, as |
| 2257 | * (this is intentional so it can be allocated along with | 2367 | * there's no netdev registration in that case it may not be |
| 2258 | * the netdev.) | 2368 | * allocated outside of callback operations that return it. |
| 2259 | * | 2369 | * |
| 2260 | * @wiphy: pointer to hardware description | 2370 | * @wiphy: pointer to hardware description |
| 2261 | * @iftype: interface type | 2371 | * @iftype: interface type |
| 2262 | * @list: (private) Used to collect the interfaces | 2372 | * @list: (private) Used to collect the interfaces |
| 2263 | * @netdev: (private) Used to reference back to the netdev | 2373 | * @netdev: (private) Used to reference back to the netdev, may be %NULL |
| 2374 | * @identifier: (private) Identifier used in nl80211 to identify this | ||
| 2375 | * wireless device if it has no netdev | ||
| 2264 | * @current_bss: (private) Used by the internal configuration code | 2376 | * @current_bss: (private) Used by the internal configuration code |
| 2265 | * @channel: (private) Used by the internal configuration code to track | 2377 | * @channel: (private) Used by the internal configuration code to track |
| 2266 | * user-set AP, monitor and WDS channels for wireless extensions | 2378 | * the user-set AP, monitor and WDS channel |
| 2379 | * @preset_chan: (private) Used by the internal configuration code to | ||
| 2380 | * track the channel to be used for AP later | ||
| 2381 | * @preset_chantype: (private) the corresponding channel type | ||
| 2267 | * @bssid: (private) Used by the internal configuration code | 2382 | * @bssid: (private) Used by the internal configuration code |
| 2268 | * @ssid: (private) Used by the internal configuration code | 2383 | * @ssid: (private) Used by the internal configuration code |
| 2269 | * @ssid_len: (private) Used by the internal configuration code | 2384 | * @ssid_len: (private) Used by the internal configuration code |
| @@ -2289,6 +2404,8 @@ struct wireless_dev { | |||
| 2289 | struct list_head list; | 2404 | struct list_head list; |
| 2290 | struct net_device *netdev; | 2405 | struct net_device *netdev; |
| 2291 | 2406 | ||
| 2407 | u32 identifier; | ||
| 2408 | |||
| 2292 | struct list_head mgmt_registrations; | 2409 | struct list_head mgmt_registrations; |
| 2293 | spinlock_t mgmt_registrations_lock; | 2410 | spinlock_t mgmt_registrations_lock; |
| 2294 | 2411 | ||
| @@ -2313,8 +2430,14 @@ struct wireless_dev { | |||
| 2313 | spinlock_t event_lock; | 2430 | spinlock_t event_lock; |
| 2314 | 2431 | ||
| 2315 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2432 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
| 2433 | struct ieee80211_channel *preset_chan; | ||
| 2434 | enum nl80211_channel_type preset_chantype; | ||
| 2435 | |||
| 2436 | /* for AP and mesh channel tracking */ | ||
| 2316 | struct ieee80211_channel *channel; | 2437 | struct ieee80211_channel *channel; |
| 2317 | 2438 | ||
| 2439 | bool ibss_fixed; | ||
| 2440 | |||
| 2318 | bool ps; | 2441 | bool ps; |
| 2319 | int ps_timeout; | 2442 | int ps_timeout; |
| 2320 | 2443 | ||
| @@ -3169,7 +3292,7 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
| 3169 | 3292 | ||
| 3170 | /** | 3293 | /** |
| 3171 | * cfg80211_ready_on_channel - notification of remain_on_channel start | 3294 | * cfg80211_ready_on_channel - notification of remain_on_channel start |
| 3172 | * @dev: network device | 3295 | * @wdev: wireless device |
| 3173 | * @cookie: the request cookie | 3296 | * @cookie: the request cookie |
| 3174 | * @chan: The current channel (from remain_on_channel request) | 3297 | * @chan: The current channel (from remain_on_channel request) |
| 3175 | * @channel_type: Channel type | 3298 | * @channel_type: Channel type |
| @@ -3177,21 +3300,20 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
| 3177 | * channel | 3300 | * channel |
| 3178 | * @gfp: allocation flags | 3301 | * @gfp: allocation flags |
| 3179 | */ | 3302 | */ |
| 3180 | void cfg80211_ready_on_channel(struct net_device *dev, u64 cookie, | 3303 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
| 3181 | struct ieee80211_channel *chan, | 3304 | struct ieee80211_channel *chan, |
| 3182 | enum nl80211_channel_type channel_type, | 3305 | enum nl80211_channel_type channel_type, |
| 3183 | unsigned int duration, gfp_t gfp); | 3306 | unsigned int duration, gfp_t gfp); |
| 3184 | 3307 | ||
| 3185 | /** | 3308 | /** |
| 3186 | * cfg80211_remain_on_channel_expired - remain_on_channel duration expired | 3309 | * cfg80211_remain_on_channel_expired - remain_on_channel duration expired |
| 3187 | * @dev: network device | 3310 | * @wdev: wireless device |
| 3188 | * @cookie: the request cookie | 3311 | * @cookie: the request cookie |
| 3189 | * @chan: The current channel (from remain_on_channel request) | 3312 | * @chan: The current channel (from remain_on_channel request) |
| 3190 | * @channel_type: Channel type | 3313 | * @channel_type: Channel type |
| 3191 | * @gfp: allocation flags | 3314 | * @gfp: allocation flags |
| 3192 | */ | 3315 | */ |
| 3193 | void cfg80211_remain_on_channel_expired(struct net_device *dev, | 3316 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
| 3194 | u64 cookie, | ||
| 3195 | struct ieee80211_channel *chan, | 3317 | struct ieee80211_channel *chan, |
| 3196 | enum nl80211_channel_type channel_type, | 3318 | enum nl80211_channel_type channel_type, |
| 3197 | gfp_t gfp); | 3319 | gfp_t gfp); |
| @@ -3219,7 +3341,7 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
| 3219 | 3341 | ||
| 3220 | /** | 3342 | /** |
| 3221 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame | 3343 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
| 3222 | * @dev: network device | 3344 | * @wdev: wireless device receiving the frame |
| 3223 | * @freq: Frequency on which the frame was received in MHz | 3345 | * @freq: Frequency on which the frame was received in MHz |
| 3224 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3346 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
| 3225 | * @buf: Management frame (header + body) | 3347 | * @buf: Management frame (header + body) |
| @@ -3234,12 +3356,12 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp); | |||
| 3234 | * This function is called whenever an Action frame is received for a station | 3356 | * This function is called whenever an Action frame is received for a station |
| 3235 | * mode interface, but is not processed in kernel. | 3357 | * mode interface, but is not processed in kernel. |
| 3236 | */ | 3358 | */ |
| 3237 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, | 3359 | bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, |
| 3238 | const u8 *buf, size_t len, gfp_t gfp); | 3360 | const u8 *buf, size_t len, gfp_t gfp); |
| 3239 | 3361 | ||
| 3240 | /** | 3362 | /** |
| 3241 | * cfg80211_mgmt_tx_status - notification of TX status for management frame | 3363 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
| 3242 | * @dev: network device | 3364 | * @wdev: wireless device receiving the frame |
| 3243 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() | 3365 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() |
| 3244 | * @buf: Management frame (header + body) | 3366 | * @buf: Management frame (header + body) |
| 3245 | * @len: length of the frame data | 3367 | * @len: length of the frame data |
| @@ -3250,7 +3372,7 @@ bool cfg80211_rx_mgmt(struct net_device *dev, int freq, int sig_dbm, | |||
| 3250 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the | 3372 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the |
| 3251 | * transmission attempt. | 3373 | * transmission attempt. |
| 3252 | */ | 3374 | */ |
| 3253 | void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, | 3375 | void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, |
| 3254 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 3376 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
| 3255 | 3377 | ||
| 3256 | 3378 | ||
| @@ -3280,6 +3402,21 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev, | |||
| 3280 | const u8 *peer, u32 num_packets, gfp_t gfp); | 3402 | const u8 *peer, u32 num_packets, gfp_t gfp); |
| 3281 | 3403 | ||
| 3282 | /** | 3404 | /** |
| 3405 | * cfg80211_cqm_txe_notify - TX error rate event | ||
| 3406 | * @dev: network device | ||
| 3407 | * @peer: peer's MAC address | ||
| 3408 | * @num_packets: how many packets were lost | ||
| 3409 | * @rate: % of packets which failed transmission | ||
| 3410 | * @intvl: interval (in s) over which the TX failure threshold was breached. | ||
| 3411 | * @gfp: context flags | ||
| 3412 | * | ||
| 3413 | * Notify userspace when configured % TX failures over number of packets in a | ||
| 3414 | * given interval is exceeded. | ||
| 3415 | */ | ||
| 3416 | void cfg80211_cqm_txe_notify(struct net_device *dev, const u8 *peer, | ||
| 3417 | u32 num_packets, u32 rate, u32 intvl, gfp_t gfp); | ||
| 3418 | |||
| 3419 | /** | ||
| 3283 | * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying | 3420 | * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying |
| 3284 | * @dev: network device | 3421 | * @dev: network device |
| 3285 | * @bssid: BSSID of AP (to avoid races) | 3422 | * @bssid: BSSID of AP (to avoid races) |
| @@ -3359,11 +3496,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
| 3359 | const u8 *frame, size_t len, | 3496 | const u8 *frame, size_t len, |
| 3360 | int freq, int sig_dbm, gfp_t gfp); | 3497 | int freq, int sig_dbm, gfp_t gfp); |
| 3361 | 3498 | ||
| 3362 | /* | 3499 | /** |
| 3363 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3500 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used |
| 3364 | * @wiphy: the wiphy | 3501 | * @wiphy: the wiphy |
| 3365 | * @chan: main channel | 3502 | * @chan: main channel |
| 3366 | * @channel_type: HT mode | 3503 | * @channel_type: HT mode |
| 3504 | * | ||
| 3505 | * This function returns true if there is no secondary channel or the secondary | ||
| 3506 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | ||
| 3367 | */ | 3507 | */ |
| 3368 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3508 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, |
| 3369 | struct ieee80211_channel *chan, | 3509 | struct ieee80211_channel *chan, |
| @@ -3386,7 +3526,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | |||
| 3386 | * | 3526 | * |
| 3387 | * return 0 if MCS index >= 32 | 3527 | * return 0 if MCS index >= 32 |
| 3388 | */ | 3528 | */ |
| 3389 | u16 cfg80211_calculate_bitrate(struct rate_info *rate); | 3529 | u32 cfg80211_calculate_bitrate(struct rate_info *rate); |
| 3390 | 3530 | ||
| 3391 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3531 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 3392 | 3532 | ||
diff --git a/include/net/dn_route.h b/include/net/dn_route.h index c507e05d172f..4f7d6a182381 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h | |||
| @@ -67,6 +67,8 @@ extern void dn_rt_cache_flush(int delay); | |||
| 67 | struct dn_route { | 67 | struct dn_route { |
| 68 | struct dst_entry dst; | 68 | struct dst_entry dst; |
| 69 | 69 | ||
| 70 | struct neighbour *n; | ||
| 71 | |||
| 70 | struct flowidn fld; | 72 | struct flowidn fld; |
| 71 | 73 | ||
| 72 | __le16 rt_saddr; | 74 | __le16 rt_saddr; |
diff --git a/include/net/dst.h b/include/net/dst.h index 8197eadca819..baf597890064 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -42,16 +42,16 @@ struct dst_entry { | |||
| 42 | struct dst_entry *from; | 42 | struct dst_entry *from; |
| 43 | }; | 43 | }; |
| 44 | struct dst_entry *path; | 44 | struct dst_entry *path; |
| 45 | struct neighbour __rcu *_neighbour; | 45 | void *__pad0; |
| 46 | #ifdef CONFIG_XFRM | 46 | #ifdef CONFIG_XFRM |
| 47 | struct xfrm_state *xfrm; | 47 | struct xfrm_state *xfrm; |
| 48 | #else | 48 | #else |
| 49 | void *__pad1; | 49 | void *__pad1; |
| 50 | #endif | 50 | #endif |
| 51 | int (*input)(struct sk_buff*); | 51 | int (*input)(struct sk_buff *); |
| 52 | int (*output)(struct sk_buff*); | 52 | int (*output)(struct sk_buff *); |
| 53 | 53 | ||
| 54 | int flags; | 54 | unsigned short flags; |
| 55 | #define DST_HOST 0x0001 | 55 | #define DST_HOST 0x0001 |
| 56 | #define DST_NOXFRM 0x0002 | 56 | #define DST_NOXFRM 0x0002 |
| 57 | #define DST_NOPOLICY 0x0004 | 57 | #define DST_NOPOLICY 0x0004 |
| @@ -62,8 +62,23 @@ struct dst_entry { | |||
| 62 | #define DST_FAKE_RTABLE 0x0080 | 62 | #define DST_FAKE_RTABLE 0x0080 |
| 63 | #define DST_XFRM_TUNNEL 0x0100 | 63 | #define DST_XFRM_TUNNEL 0x0100 |
| 64 | 64 | ||
| 65 | unsigned short pending_confirm; | ||
| 66 | |||
| 65 | short error; | 67 | short error; |
| 68 | |||
| 69 | /* A non-zero value of dst->obsolete forces by-hand validation | ||
| 70 | * of the route entry. Positive values are set by the generic | ||
| 71 | * dst layer to indicate that the entry has been forcefully | ||
| 72 | * destroyed. | ||
| 73 | * | ||
| 74 | * Negative values are used by the implementation layer code to | ||
| 75 | * force invocation of the dst_ops->check() method. | ||
| 76 | */ | ||
| 66 | short obsolete; | 77 | short obsolete; |
| 78 | #define DST_OBSOLETE_NONE 0 | ||
| 79 | #define DST_OBSOLETE_DEAD 2 | ||
| 80 | #define DST_OBSOLETE_FORCE_CHK -1 | ||
| 81 | #define DST_OBSOLETE_KILL -2 | ||
| 67 | unsigned short header_len; /* more space at head required */ | 82 | unsigned short header_len; /* more space at head required */ |
| 68 | unsigned short trailer_len; /* space to reserve at tail */ | 83 | unsigned short trailer_len; /* space to reserve at tail */ |
| 69 | #ifdef CONFIG_IP_ROUTE_CLASSID | 84 | #ifdef CONFIG_IP_ROUTE_CLASSID |
| @@ -94,21 +109,6 @@ struct dst_entry { | |||
| 94 | }; | 109 | }; |
| 95 | }; | 110 | }; |
| 96 | 111 | ||
| 97 | static inline struct neighbour *dst_get_neighbour_noref(struct dst_entry *dst) | ||
| 98 | { | ||
| 99 | return rcu_dereference(dst->_neighbour); | ||
| 100 | } | ||
| 101 | |||
| 102 | static inline struct neighbour *dst_get_neighbour_noref_raw(struct dst_entry *dst) | ||
| 103 | { | ||
| 104 | return rcu_dereference_raw(dst->_neighbour); | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) | ||
| 108 | { | ||
| 109 | rcu_assign_pointer(dst->_neighbour, neigh); | ||
| 110 | } | ||
| 111 | |||
| 112 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); | 112 | extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); |
| 113 | extern const u32 dst_default_metrics[RTAX_MAX]; | 113 | extern const u32 dst_default_metrics[RTAX_MAX]; |
| 114 | 114 | ||
| @@ -222,12 +222,6 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr | |||
| 222 | return msecs_to_jiffies(dst_metric(dst, metric)); | 222 | return msecs_to_jiffies(dst_metric(dst, metric)); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | ||
| 226 | unsigned long rtt) | ||
| 227 | { | ||
| 228 | dst_metric_set(dst, metric, jiffies_to_msecs(rtt)); | ||
| 229 | } | ||
| 230 | |||
| 231 | static inline u32 | 225 | static inline u32 |
| 232 | dst_allfrag(const struct dst_entry *dst) | 226 | dst_allfrag(const struct dst_entry *dst) |
| 233 | { | 227 | { |
| @@ -241,7 +235,7 @@ dst_metric_locked(const struct dst_entry *dst, int metric) | |||
| 241 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); | 235 | return dst_metric(dst, RTAX_LOCK) & (1<<metric); |
| 242 | } | 236 | } |
| 243 | 237 | ||
| 244 | static inline void dst_hold(struct dst_entry * dst) | 238 | static inline void dst_hold(struct dst_entry *dst) |
| 245 | { | 239 | { |
| 246 | /* | 240 | /* |
| 247 | * If your kernel compilation stops here, please check | 241 | * If your kernel compilation stops here, please check |
| @@ -264,8 +258,7 @@ static inline void dst_use_noref(struct dst_entry *dst, unsigned long time) | |||
| 264 | dst->lastuse = time; | 258 | dst->lastuse = time; |
| 265 | } | 259 | } |
| 266 | 260 | ||
| 267 | static inline | 261 | static inline struct dst_entry *dst_clone(struct dst_entry *dst) |
| 268 | struct dst_entry * dst_clone(struct dst_entry * dst) | ||
| 269 | { | 262 | { |
| 270 | if (dst) | 263 | if (dst) |
| 271 | atomic_inc(&dst->__refcnt); | 264 | atomic_inc(&dst->__refcnt); |
| @@ -371,14 +364,15 @@ static inline struct dst_entry *skb_dst_pop(struct sk_buff *skb) | |||
| 371 | } | 364 | } |
| 372 | 365 | ||
| 373 | extern int dst_discard(struct sk_buff *skb); | 366 | extern int dst_discard(struct sk_buff *skb); |
| 374 | extern void *dst_alloc(struct dst_ops * ops, struct net_device *dev, | 367 | extern void *dst_alloc(struct dst_ops *ops, struct net_device *dev, |
| 375 | int initial_ref, int initial_obsolete, int flags); | 368 | int initial_ref, int initial_obsolete, |
| 376 | extern void __dst_free(struct dst_entry * dst); | 369 | unsigned short flags); |
| 377 | extern struct dst_entry *dst_destroy(struct dst_entry * dst); | 370 | extern void __dst_free(struct dst_entry *dst); |
| 371 | extern struct dst_entry *dst_destroy(struct dst_entry *dst); | ||
| 378 | 372 | ||
| 379 | static inline void dst_free(struct dst_entry * dst) | 373 | static inline void dst_free(struct dst_entry *dst) |
| 380 | { | 374 | { |
| 381 | if (dst->obsolete > 1) | 375 | if (dst->obsolete > 0) |
| 382 | return; | 376 | return; |
| 383 | if (!atomic_read(&dst->__refcnt)) { | 377 | if (!atomic_read(&dst->__refcnt)) { |
| 384 | dst = dst_destroy(dst); | 378 | dst = dst_destroy(dst); |
| @@ -396,19 +390,35 @@ static inline void dst_rcu_free(struct rcu_head *head) | |||
| 396 | 390 | ||
| 397 | static inline void dst_confirm(struct dst_entry *dst) | 391 | static inline void dst_confirm(struct dst_entry *dst) |
| 398 | { | 392 | { |
| 399 | if (dst) { | 393 | dst->pending_confirm = 1; |
| 400 | struct neighbour *n; | 394 | } |
| 401 | 395 | ||
| 402 | rcu_read_lock(); | 396 | static inline int dst_neigh_output(struct dst_entry *dst, struct neighbour *n, |
| 403 | n = dst_get_neighbour_noref(dst); | 397 | struct sk_buff *skb) |
| 404 | neigh_confirm(n); | 398 | { |
| 405 | rcu_read_unlock(); | 399 | struct hh_cache *hh; |
| 400 | |||
| 401 | if (unlikely(dst->pending_confirm)) { | ||
| 402 | n->confirmed = jiffies; | ||
| 403 | dst->pending_confirm = 0; | ||
| 406 | } | 404 | } |
| 405 | |||
| 406 | hh = &n->hh; | ||
| 407 | if ((n->nud_state & NUD_CONNECTED) && hh->hh_len) | ||
| 408 | return neigh_hh_output(hh, skb); | ||
| 409 | else | ||
| 410 | return n->output(n, skb); | ||
| 407 | } | 411 | } |
| 408 | 412 | ||
| 409 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) | 413 | static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr) |
| 410 | { | 414 | { |
| 411 | return dst->ops->neigh_lookup(dst, daddr); | 415 | return dst->ops->neigh_lookup(dst, NULL, daddr); |
| 416 | } | ||
| 417 | |||
| 418 | static inline struct neighbour *dst_neigh_lookup_skb(const struct dst_entry *dst, | ||
| 419 | struct sk_buff *skb) | ||
| 420 | { | ||
| 421 | return dst->ops->neigh_lookup(dst, skb, NULL); | ||
| 412 | } | 422 | } |
| 413 | 423 | ||
| 414 | static inline void dst_link_failure(struct sk_buff *skb) | 424 | static inline void dst_link_failure(struct sk_buff *skb) |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index 3682a0a076c1..2f26dfb8450e 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
| @@ -8,6 +8,7 @@ struct dst_entry; | |||
| 8 | struct kmem_cachep; | 8 | struct kmem_cachep; |
| 9 | struct net_device; | 9 | struct net_device; |
| 10 | struct sk_buff; | 10 | struct sk_buff; |
| 11 | struct sock; | ||
| 11 | 12 | ||
| 12 | struct dst_ops { | 13 | struct dst_ops { |
| 13 | unsigned short family; | 14 | unsigned short family; |
| @@ -24,9 +25,14 @@ struct dst_ops { | |||
| 24 | struct net_device *dev, int how); | 25 | struct net_device *dev, int how); |
| 25 | struct dst_entry * (*negative_advice)(struct dst_entry *); | 26 | struct dst_entry * (*negative_advice)(struct dst_entry *); |
| 26 | void (*link_failure)(struct sk_buff *); | 27 | void (*link_failure)(struct sk_buff *); |
| 27 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | 28 | void (*update_pmtu)(struct dst_entry *dst, struct sock *sk, |
| 29 | struct sk_buff *skb, u32 mtu); | ||
| 30 | void (*redirect)(struct dst_entry *dst, struct sock *sk, | ||
| 31 | struct sk_buff *skb); | ||
| 28 | int (*local_out)(struct sk_buff *skb); | 32 | int (*local_out)(struct sk_buff *skb); |
| 29 | struct neighbour * (*neigh_lookup)(const struct dst_entry *dst, const void *daddr); | 33 | struct neighbour * (*neigh_lookup)(const struct dst_entry *dst, |
| 34 | struct sk_buff *skb, | ||
| 35 | const void *daddr); | ||
| 30 | 36 | ||
| 31 | struct kmem_cache *kmem_cachep; | 37 | struct kmem_cache *kmem_cachep; |
| 32 | 38 | ||
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index 075f1e3a0fed..e361f4882426 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -52,6 +52,7 @@ struct fib_rules_ops { | |||
| 52 | struct sk_buff *, | 52 | struct sk_buff *, |
| 53 | struct fib_rule_hdr *, | 53 | struct fib_rule_hdr *, |
| 54 | struct nlattr **); | 54 | struct nlattr **); |
| 55 | void (*delete)(struct fib_rule *); | ||
| 55 | int (*compare)(struct fib_rule *, | 56 | int (*compare)(struct fib_rule *, |
| 56 | struct fib_rule_hdr *, | 57 | struct fib_rule_hdr *, |
| 57 | struct nlattr **); | 58 | struct nlattr **); |
diff --git a/include/net/flow.h b/include/net/flow.h index 6c469dbdb917..e1dd5082ec7e 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -20,8 +20,7 @@ struct flowi_common { | |||
| 20 | __u8 flowic_proto; | 20 | __u8 flowic_proto; |
| 21 | __u8 flowic_flags; | 21 | __u8 flowic_flags; |
| 22 | #define FLOWI_FLAG_ANYSRC 0x01 | 22 | #define FLOWI_FLAG_ANYSRC 0x01 |
| 23 | #define FLOWI_FLAG_PRECOW_METRICS 0x02 | 23 | #define FLOWI_FLAG_CAN_SLEEP 0x02 |
| 24 | #define FLOWI_FLAG_CAN_SLEEP 0x04 | ||
| 25 | __u32 flowic_secid; | 24 | __u32 flowic_secid; |
| 26 | }; | 25 | }; |
| 27 | 26 | ||
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index ccb68880abf5..48905cd3884c 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | #include <net/netlink.h> | 5 | #include <net/netlink.h> |
| 6 | #include <net/net_namespace.h> | 6 | #include <net/net_namespace.h> |
| 7 | 7 | ||
| 8 | #define GENLMSG_DEFAULT_SIZE (NLMSG_DEFAULT_SIZE - GENL_HDRLEN) | ||
| 9 | |||
| 8 | /** | 10 | /** |
| 9 | * struct genl_multicast_group - generic netlink multicast group | 11 | * struct genl_multicast_group - generic netlink multicast group |
| 10 | * @name: name of the multicast group, names are per-family | 12 | * @name: name of the multicast group, names are per-family |
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h index 1866a676c810..04642c920431 100644 --- a/include/net/inet6_connection_sock.h +++ b/include/net/inet6_connection_sock.h | |||
| @@ -26,6 +26,7 @@ extern int inet6_csk_bind_conflict(const struct sock *sk, | |||
| 26 | const struct inet_bind_bucket *tb, bool relax); | 26 | const struct inet_bind_bucket *tb, bool relax); |
| 27 | 27 | ||
| 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, | 28 | extern struct dst_entry* inet6_csk_route_req(struct sock *sk, |
| 29 | struct flowi6 *fl6, | ||
| 29 | const struct request_sock *req); | 30 | const struct request_sock *req); |
| 30 | 31 | ||
| 31 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, | 32 | extern struct request_sock *inet6_csk_search_req(const struct sock *sk, |
| @@ -42,4 +43,6 @@ extern void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | |||
| 42 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | 43 | extern void inet6_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); |
| 43 | 44 | ||
| 44 | extern int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); | 45 | extern int inet6_csk_xmit(struct sk_buff *skb, struct flowi *fl); |
| 46 | |||
| 47 | extern struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); | ||
| 45 | #endif /* _INET6_CONNECTION_SOCK_H */ | 48 | #endif /* _INET6_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_common.h b/include/net/inet_common.h index 22fac9892b16..234008782c8c 100644 --- a/include/net/inet_common.h +++ b/include/net/inet_common.h | |||
| @@ -14,9 +14,11 @@ struct sockaddr; | |||
| 14 | struct socket; | 14 | struct socket; |
| 15 | 15 | ||
| 16 | extern int inet_release(struct socket *sock); | 16 | extern int inet_release(struct socket *sock); |
| 17 | extern int inet_stream_connect(struct socket *sock, struct sockaddr * uaddr, | 17 | extern int inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 18 | int addr_len, int flags); | 18 | int addr_len, int flags); |
| 19 | extern int inet_dgram_connect(struct socket *sock, struct sockaddr * uaddr, | 19 | extern int __inet_stream_connect(struct socket *sock, struct sockaddr *uaddr, |
| 20 | int addr_len, int flags); | ||
| 21 | extern int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, | ||
| 20 | int addr_len, int flags); | 22 | int addr_len, int flags); |
| 21 | extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); | 23 | extern int inet_accept(struct socket *sock, struct socket *newsock, int flags); |
| 22 | extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, | 24 | extern int inet_sendmsg(struct kiocb *iocb, struct socket *sock, |
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 7d83f90f203f..5ee66f517b4f 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
| @@ -43,7 +43,6 @@ struct inet_connection_sock_af_ops { | |||
| 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, | 43 | struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, |
| 44 | struct request_sock *req, | 44 | struct request_sock *req, |
| 45 | struct dst_entry *dst); | 45 | struct dst_entry *dst); |
| 46 | struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it); | ||
| 47 | u16 net_header_len; | 46 | u16 net_header_len; |
| 48 | u16 net_frag_header_len; | 47 | u16 net_frag_header_len; |
| 49 | u16 sockaddr_len; | 48 | u16 sockaddr_len; |
| @@ -337,4 +336,6 @@ extern int inet_csk_compat_getsockopt(struct sock *sk, int level, int optname, | |||
| 337 | char __user *optval, int __user *optlen); | 336 | char __user *optval, int __user *optlen); |
| 338 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, | 337 | extern int inet_csk_compat_setsockopt(struct sock *sk, int level, int optname, |
| 339 | char __user *optval, unsigned int optlen); | 338 | char __user *optval, unsigned int optlen); |
| 339 | |||
| 340 | extern struct dst_entry *inet_csk_update_pmtu(struct sock *sk, u32 mtu); | ||
| 340 | #endif /* _INET_CONNECTION_SOCK_H */ | 341 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 808fc5f76b03..54be0287eb98 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -379,10 +379,10 @@ static inline struct sock *__inet_lookup_skb(struct inet_hashinfo *hashinfo, | |||
| 379 | const __be16 sport, | 379 | const __be16 sport, |
| 380 | const __be16 dport) | 380 | const __be16 dport) |
| 381 | { | 381 | { |
| 382 | struct sock *sk; | 382 | struct sock *sk = skb_steal_sock(skb); |
| 383 | const struct iphdr *iph = ip_hdr(skb); | 383 | const struct iphdr *iph = ip_hdr(skb); |
| 384 | 384 | ||
| 385 | if (unlikely(sk = skb_steal_sock(skb))) | 385 | if (sk) |
| 386 | return sk; | 386 | return sk; |
| 387 | else | 387 | else |
| 388 | return __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, | 388 | return __inet_lookup(dev_net(skb_dst(skb)->dev), hashinfo, |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index ae17e1352d7e..613cfa401672 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
| @@ -172,6 +172,7 @@ struct inet_sock { | |||
| 172 | int uc_index; | 172 | int uc_index; |
| 173 | int mc_index; | 173 | int mc_index; |
| 174 | __be32 mc_addr; | 174 | __be32 mc_addr; |
| 175 | int rx_dst_ifindex; | ||
| 175 | struct ip_mc_socklist __rcu *mc_list; | 176 | struct ip_mc_socklist __rcu *mc_list; |
| 176 | struct inet_cork_full cork; | 177 | struct inet_cork_full cork; |
| 177 | }; | 178 | }; |
| @@ -245,8 +246,6 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk) | |||
| 245 | 246 | ||
| 246 | if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) | 247 | if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl) |
| 247 | flags |= FLOWI_FLAG_ANYSRC; | 248 | flags |= FLOWI_FLAG_ANYSRC; |
| 248 | if (sk->sk_protocol == IPPROTO_TCP) | ||
| 249 | flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
| 250 | return flags; | 249 | return flags; |
| 251 | } | 250 | } |
| 252 | 251 | ||
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 2040bff945d4..53f464d7cddc 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
| @@ -36,25 +36,19 @@ struct inet_peer { | |||
| 36 | u32 metrics[RTAX_MAX]; | 36 | u32 metrics[RTAX_MAX]; |
| 37 | u32 rate_tokens; /* rate limiting for ICMP */ | 37 | u32 rate_tokens; /* rate limiting for ICMP */ |
| 38 | unsigned long rate_last; | 38 | unsigned long rate_last; |
| 39 | unsigned long pmtu_expires; | ||
| 40 | u32 pmtu_orig; | ||
| 41 | u32 pmtu_learned; | ||
| 42 | struct inetpeer_addr_base redirect_learned; | ||
| 43 | union { | 39 | union { |
| 44 | struct list_head gc_list; | 40 | struct list_head gc_list; |
| 45 | struct rcu_head gc_rcu; | 41 | struct rcu_head gc_rcu; |
| 46 | }; | 42 | }; |
| 47 | /* | 43 | /* |
| 48 | * Once inet_peer is queued for deletion (refcnt == -1), following fields | 44 | * Once inet_peer is queued for deletion (refcnt == -1), following fields |
| 49 | * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp | 45 | * are not available: rid, ip_id_count |
| 50 | * We can share memory with rcu_head to help keep inet_peer small. | 46 | * We can share memory with rcu_head to help keep inet_peer small. |
| 51 | */ | 47 | */ |
| 52 | union { | 48 | union { |
| 53 | struct { | 49 | struct { |
| 54 | atomic_t rid; /* Frag reception counter */ | 50 | atomic_t rid; /* Frag reception counter */ |
| 55 | atomic_t ip_id_count; /* IP ID for the next packet */ | 51 | atomic_t ip_id_count; /* IP ID for the next packet */ |
| 56 | __u32 tcp_ts; | ||
| 57 | __u32 tcp_ts_stamp; | ||
| 58 | }; | 52 | }; |
| 59 | struct rcu_head rcu; | 53 | struct rcu_head rcu; |
| 60 | struct inet_peer *gc_next; | 54 | struct inet_peer *gc_next; |
| @@ -65,6 +59,69 @@ struct inet_peer { | |||
| 65 | atomic_t refcnt; | 59 | atomic_t refcnt; |
| 66 | }; | 60 | }; |
| 67 | 61 | ||
| 62 | struct inet_peer_base { | ||
| 63 | struct inet_peer __rcu *root; | ||
| 64 | seqlock_t lock; | ||
| 65 | u32 flush_seq; | ||
| 66 | int total; | ||
| 67 | }; | ||
| 68 | |||
| 69 | #define INETPEER_BASE_BIT 0x1UL | ||
| 70 | |||
| 71 | static inline struct inet_peer *inetpeer_ptr(unsigned long val) | ||
| 72 | { | ||
| 73 | BUG_ON(val & INETPEER_BASE_BIT); | ||
| 74 | return (struct inet_peer *) val; | ||
| 75 | } | ||
| 76 | |||
| 77 | static inline struct inet_peer_base *inetpeer_base_ptr(unsigned long val) | ||
| 78 | { | ||
| 79 | if (!(val & INETPEER_BASE_BIT)) | ||
| 80 | return NULL; | ||
| 81 | val &= ~INETPEER_BASE_BIT; | ||
| 82 | return (struct inet_peer_base *) val; | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline bool inetpeer_ptr_is_peer(unsigned long val) | ||
| 86 | { | ||
| 87 | return !(val & INETPEER_BASE_BIT); | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void __inetpeer_ptr_set_peer(unsigned long *val, struct inet_peer *peer) | ||
| 91 | { | ||
| 92 | /* This implicitly clears INETPEER_BASE_BIT */ | ||
| 93 | *val = (unsigned long) peer; | ||
| 94 | } | ||
| 95 | |||
| 96 | static inline bool inetpeer_ptr_set_peer(unsigned long *ptr, struct inet_peer *peer) | ||
| 97 | { | ||
| 98 | unsigned long val = (unsigned long) peer; | ||
| 99 | unsigned long orig = *ptr; | ||
| 100 | |||
| 101 | if (!(orig & INETPEER_BASE_BIT) || | ||
| 102 | cmpxchg(ptr, orig, val) != orig) | ||
| 103 | return false; | ||
| 104 | return true; | ||
| 105 | } | ||
| 106 | |||
| 107 | static inline void inetpeer_init_ptr(unsigned long *ptr, struct inet_peer_base *base) | ||
| 108 | { | ||
| 109 | *ptr = (unsigned long) base | INETPEER_BASE_BIT; | ||
| 110 | } | ||
| 111 | |||
| 112 | static inline void inetpeer_transfer_peer(unsigned long *to, unsigned long *from) | ||
| 113 | { | ||
| 114 | unsigned long val = *from; | ||
| 115 | |||
| 116 | *to = val; | ||
| 117 | if (inetpeer_ptr_is_peer(val)) { | ||
| 118 | struct inet_peer *peer = inetpeer_ptr(val); | ||
| 119 | atomic_inc(&peer->refcnt); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | |||
| 123 | extern void inet_peer_base_init(struct inet_peer_base *); | ||
| 124 | |||
| 68 | void inet_initpeers(void) __init; | 125 | void inet_initpeers(void) __init; |
| 69 | 126 | ||
| 70 | #define INETPEER_METRICS_NEW (~(u32) 0) | 127 | #define INETPEER_METRICS_NEW (~(u32) 0) |
| @@ -75,31 +132,38 @@ static inline bool inet_metrics_new(const struct inet_peer *p) | |||
| 75 | } | 132 | } |
| 76 | 133 | ||
| 77 | /* can be called with or without local BH being disabled */ | 134 | /* can be called with or without local BH being disabled */ |
| 78 | struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create); | 135 | struct inet_peer *inet_getpeer(struct inet_peer_base *base, |
| 136 | const struct inetpeer_addr *daddr, | ||
| 137 | int create); | ||
| 79 | 138 | ||
| 80 | static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | 139 | static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base, |
| 140 | __be32 v4daddr, | ||
| 141 | int create) | ||
| 81 | { | 142 | { |
| 82 | struct inetpeer_addr daddr; | 143 | struct inetpeer_addr daddr; |
| 83 | 144 | ||
| 84 | daddr.addr.a4 = v4daddr; | 145 | daddr.addr.a4 = v4daddr; |
| 85 | daddr.family = AF_INET; | 146 | daddr.family = AF_INET; |
| 86 | return inet_getpeer(&daddr, create); | 147 | return inet_getpeer(base, &daddr, create); |
| 87 | } | 148 | } |
| 88 | 149 | ||
| 89 | static inline struct inet_peer *inet_getpeer_v6(const struct in6_addr *v6daddr, int create) | 150 | static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base, |
| 151 | const struct in6_addr *v6daddr, | ||
| 152 | int create) | ||
| 90 | { | 153 | { |
| 91 | struct inetpeer_addr daddr; | 154 | struct inetpeer_addr daddr; |
| 92 | 155 | ||
| 93 | *(struct in6_addr *)daddr.addr.a6 = *v6daddr; | 156 | *(struct in6_addr *)daddr.addr.a6 = *v6daddr; |
| 94 | daddr.family = AF_INET6; | 157 | daddr.family = AF_INET6; |
| 95 | return inet_getpeer(&daddr, create); | 158 | return inet_getpeer(base, &daddr, create); |
| 96 | } | 159 | } |
| 97 | 160 | ||
| 98 | /* can be called from BH context or outside */ | 161 | /* can be called from BH context or outside */ |
| 99 | extern void inet_putpeer(struct inet_peer *p); | 162 | extern void inet_putpeer(struct inet_peer *p); |
| 100 | extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); | 163 | extern bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); |
| 101 | 164 | ||
| 102 | extern void inetpeer_invalidate_tree(int family); | 165 | extern void inetpeer_invalidate_tree(struct inet_peer_base *); |
| 166 | extern void inetpeer_invalidate_family(int family); | ||
| 103 | 167 | ||
| 104 | /* | 168 | /* |
| 105 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, | 169 | * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, |
diff --git a/include/net/ip.h b/include/net/ip.h index 83e0619f59d0..bd5e444a19ce 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -158,8 +158,9 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
| 158 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; | 158 | return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, | 161 | void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr, |
| 162 | const struct ip_reply_arg *arg, unsigned int len); | 162 | __be32 saddr, const struct ip_reply_arg *arg, |
| 163 | unsigned int len); | ||
| 163 | 164 | ||
| 164 | struct ipv4_config { | 165 | struct ipv4_config { |
| 165 | int log_martians; | 166 | int log_martians; |
| @@ -210,6 +211,9 @@ extern int inet_peer_threshold; | |||
| 210 | extern int inet_peer_minttl; | 211 | extern int inet_peer_minttl; |
| 211 | extern int inet_peer_maxttl; | 212 | extern int inet_peer_maxttl; |
| 212 | 213 | ||
| 214 | /* From ip_input.c */ | ||
| 215 | extern int sysctl_ip_early_demux; | ||
| 216 | |||
| 213 | /* From ip_output.c */ | 217 | /* From ip_output.c */ |
| 214 | extern int sysctl_ip_dynaddr; | 218 | extern int sysctl_ip_dynaddr; |
| 215 | 219 | ||
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 0ae759a6c76e..0fedbd8d747a 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -86,6 +86,8 @@ struct fib6_table; | |||
| 86 | struct rt6_info { | 86 | struct rt6_info { |
| 87 | struct dst_entry dst; | 87 | struct dst_entry dst; |
| 88 | 88 | ||
| 89 | struct neighbour *n; | ||
| 90 | |||
| 89 | /* | 91 | /* |
| 90 | * Tail elements of dst_entry (__refcnt etc.) | 92 | * Tail elements of dst_entry (__refcnt etc.) |
| 91 | * and these elements (rarely used in hot path) are in | 93 | * and these elements (rarely used in hot path) are in |
| @@ -107,7 +109,7 @@ struct rt6_info { | |||
| 107 | u32 rt6i_peer_genid; | 109 | u32 rt6i_peer_genid; |
| 108 | 110 | ||
| 109 | struct inet6_dev *rt6i_idev; | 111 | struct inet6_dev *rt6i_idev; |
| 110 | struct inet_peer *rt6i_peer; | 112 | unsigned long _rt6i_peer; |
| 111 | 113 | ||
| 112 | #ifdef CONFIG_XFRM | 114 | #ifdef CONFIG_XFRM |
| 113 | u32 rt6i_flow_cache_genid; | 115 | u32 rt6i_flow_cache_genid; |
| @@ -118,6 +120,36 @@ struct rt6_info { | |||
| 118 | u8 rt6i_protocol; | 120 | u8 rt6i_protocol; |
| 119 | }; | 121 | }; |
| 120 | 122 | ||
| 123 | static inline struct inet_peer *rt6_peer_ptr(struct rt6_info *rt) | ||
| 124 | { | ||
| 125 | return inetpeer_ptr(rt->_rt6i_peer); | ||
| 126 | } | ||
| 127 | |||
| 128 | static inline bool rt6_has_peer(struct rt6_info *rt) | ||
| 129 | { | ||
| 130 | return inetpeer_ptr_is_peer(rt->_rt6i_peer); | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline void __rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer) | ||
| 134 | { | ||
| 135 | __inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer); | ||
| 136 | } | ||
| 137 | |||
| 138 | static inline bool rt6_set_peer(struct rt6_info *rt, struct inet_peer *peer) | ||
| 139 | { | ||
| 140 | return inetpeer_ptr_set_peer(&rt->_rt6i_peer, peer); | ||
| 141 | } | ||
| 142 | |||
| 143 | static inline void rt6_init_peer(struct rt6_info *rt, struct inet_peer_base *base) | ||
| 144 | { | ||
| 145 | inetpeer_init_ptr(&rt->_rt6i_peer, base); | ||
| 146 | } | ||
| 147 | |||
| 148 | static inline void rt6_transfer_peer(struct rt6_info *rt, struct rt6_info *ort) | ||
| 149 | { | ||
| 150 | inetpeer_transfer_peer(&rt->_rt6i_peer, &ort->_rt6i_peer); | ||
| 151 | } | ||
| 152 | |||
| 121 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | 153 | static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) |
| 122 | { | 154 | { |
| 123 | return ((struct rt6_info *)dst)->rt6i_idev; | 155 | return ((struct rt6_info *)dst)->rt6i_idev; |
| @@ -207,6 +239,7 @@ struct fib6_table { | |||
| 207 | u32 tb6_id; | 239 | u32 tb6_id; |
| 208 | rwlock_t tb6_lock; | 240 | rwlock_t tb6_lock; |
| 209 | struct fib6_node tb6_root; | 241 | struct fib6_node tb6_root; |
| 242 | struct inet_peer_base tb6_peers; | ||
| 210 | }; | 243 | }; |
| 211 | 244 | ||
| 212 | #define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC | 245 | #define RT6_TABLE_UNSPEC RT_TABLE_UNSPEC |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 37c1a1ed82c1..5fa2af00634a 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -53,16 +53,25 @@ static inline unsigned int rt6_flags2srcprefs(int flags) | |||
| 53 | return (flags >> 3) & 7; | 53 | return (flags >> 3) & 7; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | extern void rt6_bind_peer(struct rt6_info *rt, | 56 | extern void rt6_bind_peer(struct rt6_info *rt, int create); |
| 57 | int create); | 57 | |
| 58 | static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create) | ||
| 59 | { | ||
| 60 | if (rt6_has_peer(rt)) | ||
| 61 | return rt6_peer_ptr(rt); | ||
| 62 | |||
| 63 | rt6_bind_peer(rt, create); | ||
| 64 | return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL); | ||
| 65 | } | ||
| 58 | 66 | ||
| 59 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) | 67 | static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt) |
| 60 | { | 68 | { |
| 61 | if (rt->rt6i_peer) | 69 | return __rt6_get_peer(rt, 0); |
| 62 | return rt->rt6i_peer; | 70 | } |
| 63 | 71 | ||
| 64 | rt6_bind_peer(rt, 0); | 72 | static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt) |
| 65 | return rt->rt6i_peer; | 73 | { |
| 74 | return __rt6_get_peer(rt, 1); | ||
| 66 | } | 75 | } |
| 67 | 76 | ||
| 68 | extern void ip6_route_input(struct sk_buff *skb); | 77 | extern void ip6_route_input(struct sk_buff *skb); |
| @@ -124,17 +133,12 @@ extern int rt6_route_rcv(struct net_device *dev, | |||
| 124 | u8 *opt, int len, | 133 | u8 *opt, int len, |
| 125 | const struct in6_addr *gwaddr); | 134 | const struct in6_addr *gwaddr); |
| 126 | 135 | ||
| 127 | extern void rt6_redirect(const struct in6_addr *dest, | 136 | extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu, |
| 128 | const struct in6_addr *src, | 137 | int oif, u32 mark); |
| 129 | const struct in6_addr *saddr, | 138 | extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, |
| 130 | struct neighbour *neigh, | 139 | __be32 mtu); |
| 131 | u8 *lladdr, | 140 | extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); |
| 132 | int on_link); | 141 | extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); |
| 133 | |||
| 134 | extern void rt6_pmtu_discovery(const struct in6_addr *daddr, | ||
| 135 | const struct in6_addr *saddr, | ||
| 136 | struct net_device *dev, | ||
| 137 | u32 pmtu); | ||
| 138 | 142 | ||
| 139 | struct netlink_callback; | 143 | struct netlink_callback; |
| 140 | 144 | ||
| @@ -154,7 +158,8 @@ extern void rt6_remove_prefsrc(struct inet6_ifaddr *ifp); | |||
| 154 | * Store a destination cache entry in a socket | 158 | * Store a destination cache entry in a socket |
| 155 | */ | 159 | */ |
| 156 | static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, | 160 | static inline void __ip6_dst_store(struct sock *sk, struct dst_entry *dst, |
| 157 | struct in6_addr *daddr, struct in6_addr *saddr) | 161 | const struct in6_addr *daddr, |
| 162 | const struct in6_addr *saddr) | ||
| 158 | { | 163 | { |
| 159 | struct ipv6_pinfo *np = inet6_sk(sk); | 164 | struct ipv6_pinfo *np = inet6_sk(sk); |
| 160 | struct rt6_info *rt = (struct rt6_info *) dst; | 165 | struct rt6_info *rt = (struct rt6_info *) dst; |
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index fc73e667b50e..358fb86f57eb 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
| @@ -9,6 +9,8 @@ | |||
| 9 | #define IP6_TNL_F_CAP_XMIT 0x10000 | 9 | #define IP6_TNL_F_CAP_XMIT 0x10000 |
| 10 | /* capable of receiving packets */ | 10 | /* capable of receiving packets */ |
| 11 | #define IP6_TNL_F_CAP_RCV 0x20000 | 11 | #define IP6_TNL_F_CAP_RCV 0x20000 |
| 12 | /* determine capability on a per-packet basis */ | ||
| 13 | #define IP6_TNL_F_CAP_PER_PACKET 0x40000 | ||
| 12 | 14 | ||
| 13 | /* IPv6 tunnel */ | 15 | /* IPv6 tunnel */ |
| 14 | 16 | ||
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 78df0866cc38..e69c3a47153d 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -18,7 +18,9 @@ | |||
| 18 | 18 | ||
| 19 | #include <net/flow.h> | 19 | #include <net/flow.h> |
| 20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
| 21 | #include <linux/rcupdate.h> | ||
| 21 | #include <net/fib_rules.h> | 22 | #include <net/fib_rules.h> |
| 23 | #include <net/inetpeer.h> | ||
| 22 | 24 | ||
| 23 | struct fib_config { | 25 | struct fib_config { |
| 24 | u8 fc_dst_len; | 26 | u8 fc_dst_len; |
| @@ -44,6 +46,23 @@ struct fib_config { | |||
| 44 | }; | 46 | }; |
| 45 | 47 | ||
| 46 | struct fib_info; | 48 | struct fib_info; |
| 49 | struct rtable; | ||
| 50 | |||
| 51 | struct fib_nh_exception { | ||
| 52 | struct fib_nh_exception __rcu *fnhe_next; | ||
| 53 | __be32 fnhe_daddr; | ||
| 54 | u32 fnhe_pmtu; | ||
| 55 | __be32 fnhe_gw; | ||
| 56 | unsigned long fnhe_expires; | ||
| 57 | unsigned long fnhe_stamp; | ||
| 58 | }; | ||
| 59 | |||
| 60 | struct fnhe_hash_bucket { | ||
| 61 | struct fib_nh_exception __rcu *chain; | ||
| 62 | }; | ||
| 63 | |||
| 64 | #define FNHE_HASH_SIZE 2048 | ||
| 65 | #define FNHE_RECLAIM_DEPTH 5 | ||
| 47 | 66 | ||
| 48 | struct fib_nh { | 67 | struct fib_nh { |
| 49 | struct net_device *nh_dev; | 68 | struct net_device *nh_dev; |
| @@ -62,6 +81,9 @@ struct fib_nh { | |||
| 62 | __be32 nh_gw; | 81 | __be32 nh_gw; |
| 63 | __be32 nh_saddr; | 82 | __be32 nh_saddr; |
| 64 | int nh_saddr_genid; | 83 | int nh_saddr_genid; |
| 84 | struct rtable *nh_rth_output; | ||
| 85 | struct rtable *nh_rth_input; | ||
| 86 | struct fnhe_hash_bucket *nh_exceptions; | ||
| 65 | }; | 87 | }; |
| 66 | 88 | ||
| 67 | /* | 89 | /* |
| @@ -105,12 +127,10 @@ struct fib_result { | |||
| 105 | unsigned char nh_sel; | 127 | unsigned char nh_sel; |
| 106 | unsigned char type; | 128 | unsigned char type; |
| 107 | unsigned char scope; | 129 | unsigned char scope; |
| 130 | u32 tclassid; | ||
| 108 | struct fib_info *fi; | 131 | struct fib_info *fi; |
| 109 | struct fib_table *table; | 132 | struct fib_table *table; |
| 110 | struct list_head *fa_head; | 133 | struct list_head *fa_head; |
| 111 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
| 112 | struct fib_rule *r; | ||
| 113 | #endif | ||
| 114 | }; | 134 | }; |
| 115 | 135 | ||
| 116 | struct fib_result_nl { | 136 | struct fib_result_nl { |
| @@ -157,11 +177,11 @@ extern __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh); | |||
| 157 | FIB_RES_SADDR(net, res)) | 177 | FIB_RES_SADDR(net, res)) |
| 158 | 178 | ||
| 159 | struct fib_table { | 179 | struct fib_table { |
| 160 | struct hlist_node tb_hlist; | 180 | struct hlist_node tb_hlist; |
| 161 | u32 tb_id; | 181 | u32 tb_id; |
| 162 | int tb_default; | 182 | int tb_default; |
| 163 | int tb_num_default; | 183 | int tb_num_default; |
| 164 | unsigned long tb_data[0]; | 184 | unsigned long tb_data[0]; |
| 165 | }; | 185 | }; |
| 166 | 186 | ||
| 167 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, | 187 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp, |
| @@ -214,24 +234,55 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp, | |||
| 214 | extern int __net_init fib4_rules_init(struct net *net); | 234 | extern int __net_init fib4_rules_init(struct net *net); |
| 215 | extern void __net_exit fib4_rules_exit(struct net *net); | 235 | extern void __net_exit fib4_rules_exit(struct net *net); |
| 216 | 236 | ||
| 217 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
| 218 | extern u32 fib_rules_tclass(const struct fib_result *res); | ||
| 219 | #endif | ||
| 220 | |||
| 221 | extern int fib_lookup(struct net *n, struct flowi4 *flp, struct fib_result *res); | ||
| 222 | |||
| 223 | extern struct fib_table *fib_new_table(struct net *net, u32 id); | 237 | extern struct fib_table *fib_new_table(struct net *net, u32 id); |
| 224 | extern struct fib_table *fib_get_table(struct net *net, u32 id); | 238 | extern struct fib_table *fib_get_table(struct net *net, u32 id); |
| 225 | 239 | ||
| 240 | extern int __fib_lookup(struct net *net, struct flowi4 *flp, | ||
| 241 | struct fib_result *res); | ||
| 242 | |||
| 243 | static inline int fib_lookup(struct net *net, struct flowi4 *flp, | ||
| 244 | struct fib_result *res) | ||
| 245 | { | ||
| 246 | if (!net->ipv4.fib_has_custom_rules) { | ||
| 247 | res->tclassid = 0; | ||
| 248 | if (net->ipv4.fib_local && | ||
| 249 | !fib_table_lookup(net->ipv4.fib_local, flp, res, | ||
| 250 | FIB_LOOKUP_NOREF)) | ||
| 251 | return 0; | ||
| 252 | if (net->ipv4.fib_main && | ||
| 253 | !fib_table_lookup(net->ipv4.fib_main, flp, res, | ||
| 254 | FIB_LOOKUP_NOREF)) | ||
| 255 | return 0; | ||
| 256 | if (net->ipv4.fib_default && | ||
| 257 | !fib_table_lookup(net->ipv4.fib_default, flp, res, | ||
| 258 | FIB_LOOKUP_NOREF)) | ||
| 259 | return 0; | ||
| 260 | return -ENETUNREACH; | ||
| 261 | } | ||
| 262 | return __fib_lookup(net, flp, res); | ||
| 263 | } | ||
| 264 | |||
| 226 | #endif /* CONFIG_IP_MULTIPLE_TABLES */ | 265 | #endif /* CONFIG_IP_MULTIPLE_TABLES */ |
| 227 | 266 | ||
| 228 | /* Exported by fib_frontend.c */ | 267 | /* Exported by fib_frontend.c */ |
| 229 | extern const struct nla_policy rtm_ipv4_policy[]; | 268 | extern const struct nla_policy rtm_ipv4_policy[]; |
| 230 | extern void ip_fib_init(void); | 269 | extern void ip_fib_init(void); |
| 270 | extern __be32 fib_compute_spec_dst(struct sk_buff *skb); | ||
| 231 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, | 271 | extern int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst, |
| 232 | u8 tos, int oif, struct net_device *dev, | 272 | u8 tos, int oif, struct net_device *dev, |
| 233 | __be32 *spec_dst, u32 *itag); | 273 | struct in_device *idev, u32 *itag); |
| 234 | extern void fib_select_default(struct fib_result *res); | 274 | extern void fib_select_default(struct fib_result *res); |
| 275 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
| 276 | static inline int fib_num_tclassid_users(struct net *net) | ||
| 277 | { | ||
| 278 | return net->ipv4.fib_num_tclassid_users; | ||
| 279 | } | ||
| 280 | #else | ||
| 281 | static inline int fib_num_tclassid_users(struct net *net) | ||
| 282 | { | ||
| 283 | return 0; | ||
| 284 | } | ||
| 285 | #endif | ||
| 235 | 286 | ||
| 236 | /* Exported by fib_semantics.c */ | 287 | /* Exported by fib_semantics.c */ |
| 237 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); | 288 | extern int ip_fib_check_default(__be32 gw, struct net_device *dev); |
| @@ -253,7 +304,7 @@ static inline void fib_combine_itag(u32 *itag, const struct fib_result *res) | |||
| 253 | #endif | 304 | #endif |
| 254 | *itag = FIB_RES_NH(*res).nh_tclassid<<16; | 305 | *itag = FIB_RES_NH(*res).nh_tclassid<<16; |
| 255 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 306 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
| 256 | rtag = fib_rules_tclass(res); | 307 | rtag = res->tclassid; |
| 257 | if (*itag == 0) | 308 | if (*itag == 0) |
| 258 | *itag = (rtag<<16); | 309 | *itag = (rtag<<16); |
| 259 | *itag |= (rtag>>16); | 310 | *itag |= (rtag>>16); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index aecf88436abf..01c34b363a34 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -251,6 +251,8 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl) | |||
| 251 | atomic_dec(&fl->users); | 251 | atomic_dec(&fl->users); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | extern void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); | ||
| 255 | |||
| 254 | extern int ip6_ra_control(struct sock *sk, int sel); | 256 | extern int ip6_ra_control(struct sock *sk, int sel); |
| 255 | 257 | ||
| 256 | extern int ipv6_parse_hopopts(struct sk_buff *skb); | 258 | extern int ipv6_parse_hopopts(struct sk_buff *skb); |
| @@ -298,14 +300,23 @@ static inline int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr | |||
| 298 | return memcmp(a1, a2, sizeof(struct in6_addr)); | 300 | return memcmp(a1, a2, sizeof(struct in6_addr)); |
| 299 | } | 301 | } |
| 300 | 302 | ||
| 301 | static inline int | 303 | static inline bool |
| 302 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | 304 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, |
| 303 | const struct in6_addr *a2) | 305 | const struct in6_addr *a2) |
| 304 | { | 306 | { |
| 307 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
| 308 | const unsigned long *ul1 = (const unsigned long *)a1; | ||
| 309 | const unsigned long *ulm = (const unsigned long *)m; | ||
| 310 | const unsigned long *ul2 = (const unsigned long *)a2; | ||
| 311 | |||
| 312 | return !!(((ul1[0] ^ ul2[0]) & ulm[0]) | | ||
| 313 | ((ul1[1] ^ ul2[1]) & ulm[1])); | ||
| 314 | #else | ||
| 305 | return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | | 315 | return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | |
| 306 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | | 316 | ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | |
| 307 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | | 317 | ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | |
| 308 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])); | 318 | ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3])); |
| 319 | #endif | ||
| 309 | } | 320 | } |
| 310 | 321 | ||
| 311 | static inline void ipv6_addr_prefix(struct in6_addr *pfx, | 322 | static inline void ipv6_addr_prefix(struct in6_addr *pfx, |
| @@ -335,10 +346,17 @@ static inline void ipv6_addr_set(struct in6_addr *addr, | |||
| 335 | static inline bool ipv6_addr_equal(const struct in6_addr *a1, | 346 | static inline bool ipv6_addr_equal(const struct in6_addr *a1, |
| 336 | const struct in6_addr *a2) | 347 | const struct in6_addr *a2) |
| 337 | { | 348 | { |
| 349 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
| 350 | const unsigned long *ul1 = (const unsigned long *)a1; | ||
| 351 | const unsigned long *ul2 = (const unsigned long *)a2; | ||
| 352 | |||
| 353 | return ((ul1[0] ^ ul2[0]) | (ul1[1] ^ ul2[1])) == 0UL; | ||
| 354 | #else | ||
| 338 | return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | | 355 | return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | |
| 339 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | | 356 | (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | |
| 340 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | | 357 | (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | |
| 341 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; | 358 | (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0; |
| 359 | #endif | ||
| 342 | } | 360 | } |
| 343 | 361 | ||
| 344 | static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 362 | static inline bool __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, |
| @@ -391,8 +409,27 @@ bool ip6_frag_match(struct inet_frag_queue *q, void *a); | |||
| 391 | 409 | ||
| 392 | static inline bool ipv6_addr_any(const struct in6_addr *a) | 410 | static inline bool ipv6_addr_any(const struct in6_addr *a) |
| 393 | { | 411 | { |
| 412 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
| 413 | const unsigned long *ul = (const unsigned long *)a; | ||
| 414 | |||
| 415 | return (ul[0] | ul[1]) == 0UL; | ||
| 416 | #else | ||
| 394 | return (a->s6_addr32[0] | a->s6_addr32[1] | | 417 | return (a->s6_addr32[0] | a->s6_addr32[1] | |
| 395 | a->s6_addr32[2] | a->s6_addr32[3]) == 0; | 418 | a->s6_addr32[2] | a->s6_addr32[3]) == 0; |
| 419 | #endif | ||
| 420 | } | ||
| 421 | |||
| 422 | static inline u32 ipv6_addr_hash(const struct in6_addr *a) | ||
| 423 | { | ||
| 424 | #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64 | ||
| 425 | const unsigned long *ul = (const unsigned long *)a; | ||
| 426 | unsigned long x = ul[0] ^ ul[1]; | ||
| 427 | |||
| 428 | return (u32)(x ^ (x >> 32)); | ||
| 429 | #else | ||
| 430 | return (__force u32)(a->s6_addr32[0] ^ a->s6_addr32[1] ^ | ||
| 431 | a->s6_addr32[2] ^ a->s6_addr32[3]); | ||
| 432 | #endif | ||
| 396 | } | 433 | } |
| 397 | 434 | ||
| 398 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) | 435 | static inline bool ipv6_addr_loopback(const struct in6_addr *a) |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 95e39b6a02ec..bb86aa6f98dd 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -233,8 +233,10 @@ enum ieee80211_rssi_event { | |||
| 233 | * valid in station mode only while @assoc is true and if also | 233 | * valid in station mode only while @assoc is true and if also |
| 234 | * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf | 234 | * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf |
| 235 | * @ps_dtim_period) | 235 | * @ps_dtim_period) |
| 236 | * @last_tsf: last beacon's/probe response's TSF timestamp (could be old | 236 | * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old |
| 237 | * as it may have been received during scanning long ago) | 237 | * as it may have been received during scanning long ago) |
| 238 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, | ||
| 239 | * the driver/device can use this to calculate synchronisation | ||
| 238 | * @beacon_int: beacon interval | 240 | * @beacon_int: beacon interval |
| 239 | * @assoc_capability: capabilities taken from assoc resp | 241 | * @assoc_capability: capabilities taken from assoc resp |
| 240 | * @basic_rates: bitmap of basic rates, each bit stands for an | 242 | * @basic_rates: bitmap of basic rates, each bit stands for an |
| @@ -281,7 +283,8 @@ struct ieee80211_bss_conf { | |||
| 281 | u8 dtim_period; | 283 | u8 dtim_period; |
| 282 | u16 beacon_int; | 284 | u16 beacon_int; |
| 283 | u16 assoc_capability; | 285 | u16 assoc_capability; |
| 284 | u64 last_tsf; | 286 | u64 sync_tsf; |
| 287 | u32 sync_device_ts; | ||
| 285 | u32 basic_rates; | 288 | u32 basic_rates; |
| 286 | int mcast_rate[IEEE80211_NUM_BANDS]; | 289 | int mcast_rate[IEEE80211_NUM_BANDS]; |
| 287 | u16 ht_operation_mode; | 290 | u16 ht_operation_mode; |
| @@ -475,7 +478,7 @@ enum mac80211_rate_control_flags { | |||
| 475 | #define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 | 478 | #define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 |
| 476 | 479 | ||
| 477 | /* maximum number of rate stages */ | 480 | /* maximum number of rate stages */ |
| 478 | #define IEEE80211_TX_MAX_RATES 5 | 481 | #define IEEE80211_TX_MAX_RATES 4 |
| 479 | 482 | ||
| 480 | /** | 483 | /** |
| 481 | * struct ieee80211_tx_rate - rate selection/status | 484 | * struct ieee80211_tx_rate - rate selection/status |
| @@ -563,11 +566,11 @@ struct ieee80211_tx_info { | |||
| 563 | } control; | 566 | } control; |
| 564 | struct { | 567 | struct { |
| 565 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; | 568 | struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; |
| 566 | u8 ampdu_ack_len; | ||
| 567 | int ack_signal; | 569 | int ack_signal; |
| 570 | u8 ampdu_ack_len; | ||
| 568 | u8 ampdu_len; | 571 | u8 ampdu_len; |
| 569 | u8 antenna; | 572 | u8 antenna; |
| 570 | /* 14 bytes free */ | 573 | /* 21 bytes free */ |
| 571 | } status; | 574 | } status; |
| 572 | struct { | 575 | struct { |
| 573 | struct ieee80211_tx_rate driver_rates[ | 576 | struct ieee80211_tx_rate driver_rates[ |
| @@ -634,7 +637,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
| 634 | info->status.rates[i].count = 0; | 637 | info->status.rates[i].count = 0; |
| 635 | 638 | ||
| 636 | BUILD_BUG_ON( | 639 | BUILD_BUG_ON( |
| 637 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23); | 640 | offsetof(struct ieee80211_tx_info, status.ack_signal) != 20); |
| 638 | memset(&info->status.ampdu_ack_len, 0, | 641 | memset(&info->status.ampdu_ack_len, 0, |
| 639 | sizeof(struct ieee80211_tx_info) - | 642 | sizeof(struct ieee80211_tx_info) - |
| 640 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); | 643 | offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); |
| @@ -696,6 +699,8 @@ enum mac80211_rx_flags { | |||
| 696 | * | 699 | * |
| 697 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function | 700 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
| 698 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | 701 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. |
| 702 | * @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use | ||
| 703 | * it but can store it and pass it back to the driver for synchronisation | ||
| 699 | * @band: the active band when this frame was received | 704 | * @band: the active band when this frame was received |
| 700 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz | 705 | * @freq: frequency the radio was tuned to when receiving this frame, in MHz |
| 701 | * @signal: signal strength when receiving this frame, either in dBm, in dB or | 706 | * @signal: signal strength when receiving this frame, either in dBm, in dB or |
| @@ -709,13 +714,14 @@ enum mac80211_rx_flags { | |||
| 709 | */ | 714 | */ |
| 710 | struct ieee80211_rx_status { | 715 | struct ieee80211_rx_status { |
| 711 | u64 mactime; | 716 | u64 mactime; |
| 712 | enum ieee80211_band band; | 717 | u32 device_timestamp; |
| 713 | int freq; | 718 | u16 flag; |
| 714 | int signal; | 719 | u16 freq; |
| 715 | int antenna; | 720 | u8 rate_idx; |
| 716 | int rate_idx; | 721 | u8 rx_flags; |
| 717 | int flag; | 722 | u8 band; |
| 718 | unsigned int rx_flags; | 723 | u8 antenna; |
| 724 | s8 signal; | ||
| 719 | }; | 725 | }; |
| 720 | 726 | ||
| 721 | /** | 727 | /** |
| @@ -1297,6 +1303,10 @@ enum ieee80211_hw_flags { | |||
| 1297 | * reports, by default it is set to _MCS, _GI and _BW but doesn't | 1303 | * reports, by default it is set to _MCS, _GI and _BW but doesn't |
| 1298 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only | 1304 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only |
| 1299 | * adding _BW is supported today. | 1305 | * adding _BW is supported today. |
| 1306 | * | ||
| 1307 | * @netdev_features: netdev features to be set in each netdev created | ||
| 1308 | * from this HW. Note only HW checksum features are currently | ||
| 1309 | * compatible with mac80211. Other feature bits will be rejected. | ||
| 1300 | */ | 1310 | */ |
| 1301 | struct ieee80211_hw { | 1311 | struct ieee80211_hw { |
| 1302 | struct ieee80211_conf conf; | 1312 | struct ieee80211_conf conf; |
| @@ -1319,6 +1329,7 @@ struct ieee80211_hw { | |||
| 1319 | u8 max_tx_aggregation_subframes; | 1329 | u8 max_tx_aggregation_subframes; |
| 1320 | u8 offchannel_tx_hw_queue; | 1330 | u8 offchannel_tx_hw_queue; |
| 1321 | u8 radiotap_mcs_details; | 1331 | u8 radiotap_mcs_details; |
| 1332 | netdev_features_t netdev_features; | ||
| 1322 | }; | 1333 | }; |
| 1323 | 1334 | ||
| 1324 | /** | 1335 | /** |
| @@ -1891,19 +1902,6 @@ enum ieee80211_rate_control_changed { | |||
| 1891 | * The low-level driver should send the frame out based on | 1902 | * The low-level driver should send the frame out based on |
| 1892 | * configuration in the TX control data. This handler should, | 1903 | * configuration in the TX control data. This handler should, |
| 1893 | * preferably, never fail and stop queues appropriately. | 1904 | * preferably, never fail and stop queues appropriately. |
| 1894 | * This must be implemented if @tx_frags is not. | ||
| 1895 | * Must be atomic. | ||
| 1896 | * | ||
| 1897 | * @tx_frags: Called to transmit multiple fragments of a single MSDU. | ||
| 1898 | * This handler must consume all fragments, sending out some of | ||
| 1899 | * them only is useless and it can't ask for some of them to be | ||
| 1900 | * queued again. If the frame is not fragmented the queue has a | ||
| 1901 | * single SKB only. To avoid issues with the networking stack | ||
| 1902 | * when TX status is reported the frames should be removed from | ||
| 1903 | * the skb queue. | ||
| 1904 | * If this is used, the tx_info @vif and @sta pointers will be | ||
| 1905 | * invalid -- you must not use them in that case. | ||
| 1906 | * This must be implemented if @tx isn't. | ||
| 1907 | * Must be atomic. | 1905 | * Must be atomic. |
| 1908 | * | 1906 | * |
| 1909 | * @start: Called before the first netdevice attached to the hardware | 1907 | * @start: Called before the first netdevice attached to the hardware |
| @@ -2183,7 +2181,10 @@ enum ieee80211_rate_control_changed { | |||
| 2183 | * offload. Frames to transmit on the off-channel channel are transmitted | 2181 | * offload. Frames to transmit on the off-channel channel are transmitted |
| 2184 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the | 2182 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the |
| 2185 | * duration (which will always be non-zero) expires, the driver must call | 2183 | * duration (which will always be non-zero) expires, the driver must call |
| 2186 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | 2184 | * ieee80211_remain_on_channel_expired(). |
| 2185 | * Note that this callback may be called while the device is in IDLE and | ||
| 2186 | * must be accepted in this case. | ||
| 2187 | * This callback may sleep. | ||
| 2187 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | 2188 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is |
| 2188 | * aborted before it expires. This callback may sleep. | 2189 | * aborted before it expires. This callback may sleep. |
| 2189 | * | 2190 | * |
| @@ -2246,11 +2247,24 @@ enum ieee80211_rate_control_changed { | |||
| 2246 | * @get_et_strings: Ethtool API to get a set of strings to describe stats | 2247 | * @get_et_strings: Ethtool API to get a set of strings to describe stats |
| 2247 | * and perhaps other supported types of ethtool data-sets. | 2248 | * and perhaps other supported types of ethtool data-sets. |
| 2248 | * | 2249 | * |
| 2250 | * @get_rssi: Get current signal strength in dBm, the function is optional | ||
| 2251 | * and can sleep. | ||
| 2252 | * | ||
| 2253 | * @mgd_prepare_tx: Prepare for transmitting a management frame for association | ||
| 2254 | * before associated. In multi-channel scenarios, a virtual interface is | ||
| 2255 | * bound to a channel before it is associated, but as it isn't associated | ||
| 2256 | * yet it need not necessarily be given airtime, in particular since any | ||
| 2257 | * transmission to a P2P GO needs to be synchronized against the GO's | ||
| 2258 | * powersave state. mac80211 will call this function before transmitting a | ||
| 2259 | * management frame prior to having successfully associated to allow the | ||
| 2260 | * driver to give it channel time for the transmission, to get a response | ||
| 2261 | * and to be able to synchronize with the GO. | ||
| 2262 | * The callback will be called before each transmission and upon return | ||
| 2263 | * mac80211 will transmit the frame right away. | ||
| 2264 | * The callback is optional and can (should!) sleep. | ||
| 2249 | */ | 2265 | */ |
| 2250 | struct ieee80211_ops { | 2266 | struct ieee80211_ops { |
| 2251 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 2267 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 2252 | void (*tx_frags)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
| 2253 | struct ieee80211_sta *sta, struct sk_buff_head *skbs); | ||
| 2254 | int (*start)(struct ieee80211_hw *hw); | 2268 | int (*start)(struct ieee80211_hw *hw); |
| 2255 | void (*stop)(struct ieee80211_hw *hw); | 2269 | void (*stop)(struct ieee80211_hw *hw); |
| 2256 | #ifdef CONFIG_PM | 2270 | #ifdef CONFIG_PM |
| @@ -2385,6 +2399,11 @@ struct ieee80211_ops { | |||
| 2385 | void (*get_et_strings)(struct ieee80211_hw *hw, | 2399 | void (*get_et_strings)(struct ieee80211_hw *hw, |
| 2386 | struct ieee80211_vif *vif, | 2400 | struct ieee80211_vif *vif, |
| 2387 | u32 sset, u8 *data); | 2401 | u32 sset, u8 *data); |
| 2402 | int (*get_rssi)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
| 2403 | struct ieee80211_sta *sta, s8 *rssi_dbm); | ||
| 2404 | |||
| 2405 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | ||
| 2406 | struct ieee80211_vif *vif); | ||
| 2388 | }; | 2407 | }; |
| 2389 | 2408 | ||
| 2390 | /** | 2409 | /** |
| @@ -3557,16 +3576,6 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
| 3557 | gfp_t gfp); | 3576 | gfp_t gfp); |
| 3558 | 3577 | ||
| 3559 | /** | 3578 | /** |
| 3560 | * ieee80211_get_operstate - get the operstate of the vif | ||
| 3561 | * | ||
| 3562 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 3563 | * | ||
| 3564 | * The driver might need to know the operstate of the net_device | ||
| 3565 | * (specifically, whether the link is IF_OPER_UP after resume) | ||
| 3566 | */ | ||
| 3567 | unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif); | ||
| 3568 | |||
| 3569 | /** | ||
| 3570 | * ieee80211_chswitch_done - Complete channel switch process | 3579 | * ieee80211_chswitch_done - Complete channel switch process |
| 3571 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3580 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 3572 | * @success: make the channel switch successful or not | 3581 | * @success: make the channel switch successful or not |
| @@ -3589,22 +3598,6 @@ void ieee80211_request_smps(struct ieee80211_vif *vif, | |||
| 3589 | enum ieee80211_smps_mode smps_mode); | 3598 | enum ieee80211_smps_mode smps_mode); |
| 3590 | 3599 | ||
| 3591 | /** | 3600 | /** |
| 3592 | * ieee80211_key_removed - disable hw acceleration for key | ||
| 3593 | * @key_conf: The key hw acceleration should be disabled for | ||
| 3594 | * | ||
| 3595 | * This allows drivers to indicate that the given key has been | ||
| 3596 | * removed from hardware acceleration, due to a new key that | ||
| 3597 | * was added. Don't use this if the key can continue to be used | ||
| 3598 | * for TX, if the key restriction is on RX only it is permitted | ||
| 3599 | * to keep the key for TX only and not call this function. | ||
| 3600 | * | ||
| 3601 | * Due to locking constraints, it may only be called during | ||
| 3602 | * @set_key. This function must be allowed to sleep, and the | ||
| 3603 | * key it tries to disable may still be used until it returns. | ||
| 3604 | */ | ||
| 3605 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | ||
| 3606 | |||
| 3607 | /** | ||
| 3608 | * ieee80211_ready_on_channel - notification of remain-on-channel start | 3601 | * ieee80211_ready_on_channel - notification of remain-on-channel start |
| 3609 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 3602 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
| 3610 | */ | 3603 | */ |
| @@ -3829,12 +3822,6 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif, | |||
| 3829 | 3822 | ||
| 3830 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); | 3823 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); |
| 3831 | 3824 | ||
| 3832 | int ieee80211_add_srates_ie(struct ieee80211_vif *vif, | ||
| 3833 | struct sk_buff *skb, bool need_basic); | ||
| 3834 | |||
| 3835 | int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, | ||
| 3836 | struct sk_buff *skb, bool need_basic); | ||
| 3837 | |||
| 3838 | /** | 3825 | /** |
| 3839 | * ieee80211_ave_rssi - report the average rssi for the specified interface | 3826 | * ieee80211_ave_rssi - report the average rssi for the specified interface |
| 3840 | * | 3827 | * |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index c9f8ab5cc687..d0d11df9cba1 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
| @@ -21,6 +21,14 @@ | |||
| 21 | 21 | ||
| 22 | #include <net/af_ieee802154.h> | 22 | #include <net/af_ieee802154.h> |
| 23 | 23 | ||
| 24 | /* General MAC frame format: | ||
| 25 | * 2 bytes: Frame Control | ||
| 26 | * 1 byte: Sequence Number | ||
| 27 | * 20 bytes: Addressing fields | ||
| 28 | * 14 bytes: Auxiliary Security Header | ||
| 29 | */ | ||
| 30 | #define MAC802154_FRAME_HARD_HEADER_LEN (2 + 1 + 20 + 14) | ||
| 31 | |||
| 24 | /* The following flags are used to indicate changed address settings from | 32 | /* The following flags are used to indicate changed address settings from |
| 25 | * the stack to the hardware. | 33 | * the stack to the hardware. |
| 26 | */ | 34 | */ |
diff --git a/include/net/ndisc.h b/include/net/ndisc.h index c02b6ad3f6c5..96a3b5c03e37 100644 --- a/include/net/ndisc.h +++ b/include/net/ndisc.h | |||
| @@ -47,6 +47,8 @@ enum { | |||
| 47 | #include <linux/icmpv6.h> | 47 | #include <linux/icmpv6.h> |
| 48 | #include <linux/in6.h> | 48 | #include <linux/in6.h> |
| 49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
| 50 | #include <linux/if_arp.h> | ||
| 51 | #include <linux/netdevice.h> | ||
| 50 | 52 | ||
| 51 | #include <net/neighbour.h> | 53 | #include <net/neighbour.h> |
| 52 | 54 | ||
| @@ -80,6 +82,54 @@ struct nd_opt_hdr { | |||
| 80 | __u8 nd_opt_len; | 82 | __u8 nd_opt_len; |
| 81 | } __packed; | 83 | } __packed; |
| 82 | 84 | ||
| 85 | /* ND options */ | ||
| 86 | struct ndisc_options { | ||
| 87 | struct nd_opt_hdr *nd_opt_array[__ND_OPT_ARRAY_MAX]; | ||
| 88 | #ifdef CONFIG_IPV6_ROUTE_INFO | ||
| 89 | struct nd_opt_hdr *nd_opts_ri; | ||
| 90 | struct nd_opt_hdr *nd_opts_ri_end; | ||
| 91 | #endif | ||
| 92 | struct nd_opt_hdr *nd_useropts; | ||
| 93 | struct nd_opt_hdr *nd_useropts_end; | ||
| 94 | }; | ||
| 95 | |||
| 96 | #define nd_opts_src_lladdr nd_opt_array[ND_OPT_SOURCE_LL_ADDR] | ||
| 97 | #define nd_opts_tgt_lladdr nd_opt_array[ND_OPT_TARGET_LL_ADDR] | ||
| 98 | #define nd_opts_pi nd_opt_array[ND_OPT_PREFIX_INFO] | ||
| 99 | #define nd_opts_pi_end nd_opt_array[__ND_OPT_PREFIX_INFO_END] | ||
| 100 | #define nd_opts_rh nd_opt_array[ND_OPT_REDIRECT_HDR] | ||
| 101 | #define nd_opts_mtu nd_opt_array[ND_OPT_MTU] | ||
| 102 | |||
| 103 | #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) | ||
| 104 | |||
| 105 | extern struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len, | ||
| 106 | struct ndisc_options *ndopts); | ||
| 107 | |||
| 108 | /* | ||
| 109 | * Return the padding between the option length and the start of the | ||
| 110 | * link addr. Currently only IP-over-InfiniBand needs this, although | ||
| 111 | * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may | ||
| 112 | * also need a pad of 2. | ||
| 113 | */ | ||
| 114 | static int ndisc_addr_option_pad(unsigned short type) | ||
| 115 | { | ||
| 116 | switch (type) { | ||
| 117 | case ARPHRD_INFINIBAND: return 2; | ||
| 118 | default: return 0; | ||
| 119 | } | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p, | ||
| 123 | struct net_device *dev) | ||
| 124 | { | ||
| 125 | u8 *lladdr = (u8 *)(p + 1); | ||
| 126 | int lladdrlen = p->nd_opt_len << 3; | ||
| 127 | int prepad = ndisc_addr_option_pad(dev->type); | ||
| 128 | if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) | ||
| 129 | return NULL; | ||
| 130 | return lladdr + prepad; | ||
| 131 | } | ||
| 132 | |||
| 83 | static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd) | 133 | static inline u32 ndisc_hashfn(const void *pkey, const struct net_device *dev, __u32 *hash_rnd) |
| 84 | { | 134 | { |
| 85 | const u32 *p32 = pkey; | 135 | const u32 *p32 = pkey; |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 6cdfeedb650b..344d8988842a 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -202,9 +202,16 @@ extern struct neighbour * neigh_lookup(struct neigh_table *tbl, | |||
| 202 | extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, | 202 | extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, |
| 203 | struct net *net, | 203 | struct net *net, |
| 204 | const void *pkey); | 204 | const void *pkey); |
| 205 | extern struct neighbour * neigh_create(struct neigh_table *tbl, | 205 | extern struct neighbour * __neigh_create(struct neigh_table *tbl, |
| 206 | const void *pkey, | ||
| 207 | struct net_device *dev, | ||
| 208 | bool want_ref); | ||
| 209 | static inline struct neighbour *neigh_create(struct neigh_table *tbl, | ||
| 206 | const void *pkey, | 210 | const void *pkey, |
| 207 | struct net_device *dev); | 211 | struct net_device *dev) |
| 212 | { | ||
| 213 | return __neigh_create(tbl, pkey, dev, true); | ||
| 214 | } | ||
| 208 | extern void neigh_destroy(struct neighbour *neigh); | 215 | extern void neigh_destroy(struct neighbour *neigh); |
| 209 | extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); | 216 | extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); |
| 210 | extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | 217 | extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, |
| @@ -302,12 +309,6 @@ static inline struct neighbour * neigh_clone(struct neighbour *neigh) | |||
| 302 | 309 | ||
| 303 | #define neigh_hold(n) atomic_inc(&(n)->refcnt) | 310 | #define neigh_hold(n) atomic_inc(&(n)->refcnt) |
| 304 | 311 | ||
| 305 | static inline void neigh_confirm(struct neighbour *neigh) | ||
| 306 | { | ||
| 307 | if (neigh) | ||
| 308 | neigh->confirmed = jiffies; | ||
| 309 | } | ||
| 310 | |||
| 311 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | 312 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) |
| 312 | { | 313 | { |
| 313 | unsigned long now = jiffies; | 314 | unsigned long now = jiffies; |
| @@ -351,15 +352,6 @@ static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | |||
| 351 | return dev_queue_xmit(skb); | 352 | return dev_queue_xmit(skb); |
| 352 | } | 353 | } |
| 353 | 354 | ||
| 354 | static inline int neigh_output(struct neighbour *n, struct sk_buff *skb) | ||
| 355 | { | ||
| 356 | struct hh_cache *hh = &n->hh; | ||
| 357 | if ((n->nud_state & NUD_CONNECTED) && hh->hh_len) | ||
| 358 | return neigh_hh_output(hh, skb); | ||
| 359 | else | ||
| 360 | return n->output(n, skb); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline struct neighbour * | 355 | static inline struct neighbour * |
| 364 | __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) | 356 | __neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) |
| 365 | { | 357 | { |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ac9195e6a062..ae1cd6c9ba52 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -101,6 +101,7 @@ struct net { | |||
| 101 | struct netns_xfrm xfrm; | 101 | struct netns_xfrm xfrm; |
| 102 | #endif | 102 | #endif |
| 103 | struct netns_ipvs *ipvs; | 103 | struct netns_ipvs *ipvs; |
| 104 | struct sock *diag_nlsk; | ||
| 104 | }; | 105 | }; |
| 105 | 106 | ||
| 106 | 107 | ||
diff --git a/include/net/netevent.h b/include/net/netevent.h index 086f8a5b59dc..3ce4988c9c08 100644 --- a/include/net/netevent.h +++ b/include/net/netevent.h | |||
| @@ -12,10 +12,14 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | struct dst_entry; | 14 | struct dst_entry; |
| 15 | struct neighbour; | ||
| 15 | 16 | ||
| 16 | struct netevent_redirect { | 17 | struct netevent_redirect { |
| 17 | struct dst_entry *old; | 18 | struct dst_entry *old; |
| 19 | struct neighbour *old_neigh; | ||
| 18 | struct dst_entry *new; | 20 | struct dst_entry *new; |
| 21 | struct neighbour *new_neigh; | ||
| 22 | const void *daddr; | ||
| 19 | }; | 23 | }; |
| 20 | 24 | ||
| 21 | enum netevent_notif_type { | 25 | enum netevent_notif_type { |
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index cce7f6a798bf..f1494feba79f 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
| @@ -39,36 +39,6 @@ union nf_conntrack_expect_proto { | |||
| 39 | /* insert expect proto private data here */ | 39 | /* insert expect proto private data here */ |
| 40 | }; | 40 | }; |
| 41 | 41 | ||
| 42 | /* Add protocol helper include file here */ | ||
| 43 | #include <linux/netfilter/nf_conntrack_ftp.h> | ||
| 44 | #include <linux/netfilter/nf_conntrack_pptp.h> | ||
| 45 | #include <linux/netfilter/nf_conntrack_h323.h> | ||
| 46 | #include <linux/netfilter/nf_conntrack_sane.h> | ||
| 47 | #include <linux/netfilter/nf_conntrack_sip.h> | ||
| 48 | |||
| 49 | /* per conntrack: application helper private data */ | ||
| 50 | union nf_conntrack_help { | ||
| 51 | /* insert conntrack helper private data (master) here */ | ||
| 52 | #if defined(CONFIG_NF_CONNTRACK_FTP) || defined(CONFIG_NF_CONNTRACK_FTP_MODULE) | ||
| 53 | struct nf_ct_ftp_master ct_ftp_info; | ||
| 54 | #endif | ||
| 55 | #if defined(CONFIG_NF_CONNTRACK_PPTP) || \ | ||
| 56 | defined(CONFIG_NF_CONNTRACK_PPTP_MODULE) | ||
| 57 | struct nf_ct_pptp_master ct_pptp_info; | ||
| 58 | #endif | ||
| 59 | #if defined(CONFIG_NF_CONNTRACK_H323) || \ | ||
| 60 | defined(CONFIG_NF_CONNTRACK_H323_MODULE) | ||
| 61 | struct nf_ct_h323_master ct_h323_info; | ||
| 62 | #endif | ||
| 63 | #if defined(CONFIG_NF_CONNTRACK_SANE) || \ | ||
| 64 | defined(CONFIG_NF_CONNTRACK_SANE_MODULE) | ||
| 65 | struct nf_ct_sane_master ct_sane_info; | ||
| 66 | #endif | ||
| 67 | #if defined(CONFIG_NF_CONNTRACK_SIP) || defined(CONFIG_NF_CONNTRACK_SIP_MODULE) | ||
| 68 | struct nf_ct_sip_master ct_sip_info; | ||
| 69 | #endif | ||
| 70 | }; | ||
| 71 | |||
| 72 | #include <linux/types.h> | 42 | #include <linux/types.h> |
| 73 | #include <linux/skbuff.h> | 43 | #include <linux/skbuff.h> |
| 74 | #include <linux/timer.h> | 44 | #include <linux/timer.h> |
| @@ -89,12 +59,13 @@ struct nf_conn_help { | |||
| 89 | /* Helper. if any */ | 59 | /* Helper. if any */ |
| 90 | struct nf_conntrack_helper __rcu *helper; | 60 | struct nf_conntrack_helper __rcu *helper; |
| 91 | 61 | ||
| 92 | union nf_conntrack_help help; | ||
| 93 | |||
| 94 | struct hlist_head expectations; | 62 | struct hlist_head expectations; |
| 95 | 63 | ||
| 96 | /* Current number of expected connections */ | 64 | /* Current number of expected connections */ |
| 97 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; | 65 | u8 expecting[NF_CT_MAX_EXPECT_CLASSES]; |
| 66 | |||
| 67 | /* private helper information. */ | ||
| 68 | char data[]; | ||
| 98 | }; | 69 | }; |
| 99 | 70 | ||
| 100 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> | 71 | #include <net/netfilter/ipv4/nf_conntrack_ipv4.h> |
diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index aced085132e7..d8f5b9f52169 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h | |||
| @@ -28,8 +28,8 @@ extern unsigned int nf_conntrack_in(struct net *net, | |||
| 28 | extern int nf_conntrack_init(struct net *net); | 28 | extern int nf_conntrack_init(struct net *net); |
| 29 | extern void nf_conntrack_cleanup(struct net *net); | 29 | extern void nf_conntrack_cleanup(struct net *net); |
| 30 | 30 | ||
| 31 | extern int nf_conntrack_proto_init(void); | 31 | extern int nf_conntrack_proto_init(struct net *net); |
| 32 | extern void nf_conntrack_proto_fini(void); | 32 | extern void nf_conntrack_proto_fini(struct net *net); |
| 33 | 33 | ||
| 34 | extern bool | 34 | extern bool |
| 35 | nf_ct_get_tuple(const struct sk_buff *skb, | 35 | nf_ct_get_tuple(const struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 4619caadd9d1..983f00263243 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
| @@ -59,10 +59,12 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) | |||
| 59 | return nf_ct_net(exp->master); | 59 | return nf_ct_net(exp->master); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | #define NF_CT_EXP_POLICY_NAME_LEN 16 | ||
| 63 | |||
| 62 | struct nf_conntrack_expect_policy { | 64 | struct nf_conntrack_expect_policy { |
| 63 | unsigned int max_expected; | 65 | unsigned int max_expected; |
| 64 | unsigned int timeout; | 66 | unsigned int timeout; |
| 65 | const char *name; | 67 | char name[NF_CT_EXP_POLICY_NAME_LEN]; |
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 70 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 96755c3798a5..8b4d1fc29096 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
| @@ -80,10 +80,13 @@ static inline void nf_ct_ext_free(struct nf_conn *ct) | |||
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | /* Add this type, returns pointer to data or NULL. */ | 82 | /* Add this type, returns pointer to data or NULL. */ |
| 83 | void * | 83 | void *__nf_ct_ext_add_length(struct nf_conn *ct, enum nf_ct_ext_id id, |
| 84 | __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); | 84 | size_t var_alloc_len, gfp_t gfp); |
| 85 | |||
| 85 | #define nf_ct_ext_add(ct, id, gfp) \ | 86 | #define nf_ct_ext_add(ct, id, gfp) \ |
| 86 | ((id##_TYPE *)__nf_ct_ext_add((ct), (id), (gfp))) | 87 | ((id##_TYPE *)__nf_ct_ext_add_length((ct), (id), 0, (gfp))) |
| 88 | #define nf_ct_ext_add_length(ct, id, len, gfp) \ | ||
| 89 | ((id##_TYPE *)__nf_ct_ext_add_length((ct), (id), (len), (gfp))) | ||
| 87 | 90 | ||
| 88 | #define NF_CT_EXT_F_PREALLOC 0x0001 | 91 | #define NF_CT_EXT_F_PREALLOC 0x0001 |
| 89 | 92 | ||
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 1d1889409b9e..9aad956d1008 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
| @@ -11,18 +11,27 @@ | |||
| 11 | #define _NF_CONNTRACK_HELPER_H | 11 | #define _NF_CONNTRACK_HELPER_H |
| 12 | #include <net/netfilter/nf_conntrack.h> | 12 | #include <net/netfilter/nf_conntrack.h> |
| 13 | #include <net/netfilter/nf_conntrack_extend.h> | 13 | #include <net/netfilter/nf_conntrack_extend.h> |
| 14 | #include <net/netfilter/nf_conntrack_expect.h> | ||
| 14 | 15 | ||
| 15 | struct module; | 16 | struct module; |
| 16 | 17 | ||
| 18 | enum nf_ct_helper_flags { | ||
| 19 | NF_CT_HELPER_F_USERSPACE = (1 << 0), | ||
| 20 | NF_CT_HELPER_F_CONFIGURED = (1 << 1), | ||
| 21 | }; | ||
| 22 | |||
| 17 | #define NF_CT_HELPER_NAME_LEN 16 | 23 | #define NF_CT_HELPER_NAME_LEN 16 |
| 18 | 24 | ||
| 19 | struct nf_conntrack_helper { | 25 | struct nf_conntrack_helper { |
| 20 | struct hlist_node hnode; /* Internal use. */ | 26 | struct hlist_node hnode; /* Internal use. */ |
| 21 | 27 | ||
| 22 | const char *name; /* name of the module */ | 28 | char name[NF_CT_HELPER_NAME_LEN]; /* name of the module */ |
| 23 | struct module *me; /* pointer to self */ | 29 | struct module *me; /* pointer to self */ |
| 24 | const struct nf_conntrack_expect_policy *expect_policy; | 30 | const struct nf_conntrack_expect_policy *expect_policy; |
| 25 | 31 | ||
| 32 | /* length of internal data, ie. sizeof(struct nf_ct_*_master) */ | ||
| 33 | size_t data_len; | ||
| 34 | |||
| 26 | /* Tuple of things we will help (compared against server response) */ | 35 | /* Tuple of things we will help (compared against server response) */ |
| 27 | struct nf_conntrack_tuple tuple; | 36 | struct nf_conntrack_tuple tuple; |
| 28 | 37 | ||
| @@ -35,8 +44,12 @@ struct nf_conntrack_helper { | |||
| 35 | 44 | ||
| 36 | void (*destroy)(struct nf_conn *ct); | 45 | void (*destroy)(struct nf_conn *ct); |
| 37 | 46 | ||
| 47 | int (*from_nlattr)(struct nlattr *attr, struct nf_conn *ct); | ||
| 38 | int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct); | 48 | int (*to_nlattr)(struct sk_buff *skb, const struct nf_conn *ct); |
| 39 | unsigned int expect_class_max; | 49 | unsigned int expect_class_max; |
| 50 | |||
| 51 | unsigned int flags; | ||
| 52 | unsigned int queue_num; /* For user-space helpers. */ | ||
| 40 | }; | 53 | }; |
| 41 | 54 | ||
| 42 | extern struct nf_conntrack_helper * | 55 | extern struct nf_conntrack_helper * |
| @@ -48,7 +61,7 @@ nf_conntrack_helper_try_module_get(const char *name, u16 l3num, u8 protonum); | |||
| 48 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); | 61 | extern int nf_conntrack_helper_register(struct nf_conntrack_helper *); |
| 49 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); | 62 | extern void nf_conntrack_helper_unregister(struct nf_conntrack_helper *); |
| 50 | 63 | ||
| 51 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, gfp_t gfp); | 64 | extern struct nf_conn_help *nf_ct_helper_ext_add(struct nf_conn *ct, struct nf_conntrack_helper *helper, gfp_t gfp); |
| 52 | 65 | ||
| 53 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, | 66 | extern int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl, |
| 54 | gfp_t flags); | 67 | gfp_t flags); |
| @@ -60,6 +73,15 @@ static inline struct nf_conn_help *nfct_help(const struct nf_conn *ct) | |||
| 60 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | 73 | return nf_ct_ext_find(ct, NF_CT_EXT_HELPER); |
| 61 | } | 74 | } |
| 62 | 75 | ||
| 76 | static inline void *nfct_help_data(const struct nf_conn *ct) | ||
| 77 | { | ||
| 78 | struct nf_conn_help *help; | ||
| 79 | |||
| 80 | help = nf_ct_ext_find(ct, NF_CT_EXT_HELPER); | ||
| 81 | |||
| 82 | return (void *)help->data; | ||
| 83 | } | ||
| 84 | |||
| 63 | extern int nf_conntrack_helper_init(struct net *net); | 85 | extern int nf_conntrack_helper_init(struct net *net); |
| 64 | extern void nf_conntrack_helper_fini(struct net *net); | 86 | extern void nf_conntrack_helper_fini(struct net *net); |
| 65 | 87 | ||
| @@ -82,4 +104,7 @@ nf_ct_helper_expectfn_find_by_name(const char *name); | |||
| 82 | struct nf_ct_helper_expectfn * | 104 | struct nf_ct_helper_expectfn * |
| 83 | nf_ct_helper_expectfn_find_by_symbol(const void *symbol); | 105 | nf_ct_helper_expectfn_find_by_symbol(const void *symbol); |
| 84 | 106 | ||
| 107 | extern struct hlist_head *nf_ct_helper_hash; | ||
| 108 | extern unsigned int nf_ct_helper_hsize; | ||
| 109 | |||
| 85 | #endif /*_NF_CONNTRACK_HELPER_H*/ | 110 | #endif /*_NF_CONNTRACK_HELPER_H*/ |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 9699c028b74b..6f7c13f4ac03 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
| @@ -64,11 +64,12 @@ struct nf_conntrack_l3proto { | |||
| 64 | size_t nla_size; | 64 | size_t nla_size; |
| 65 | 65 | ||
| 66 | #ifdef CONFIG_SYSCTL | 66 | #ifdef CONFIG_SYSCTL |
| 67 | struct ctl_table_header *ctl_table_header; | ||
| 68 | const char *ctl_table_path; | 67 | const char *ctl_table_path; |
| 69 | struct ctl_table *ctl_table; | ||
| 70 | #endif /* CONFIG_SYSCTL */ | 68 | #endif /* CONFIG_SYSCTL */ |
| 71 | 69 | ||
| 70 | /* Init l3proto pernet data */ | ||
| 71 | int (*init_net)(struct net *net); | ||
| 72 | |||
| 72 | /* Module (if any) which this is connected to. */ | 73 | /* Module (if any) which this is connected to. */ |
| 73 | struct module *me; | 74 | struct module *me; |
| 74 | }; | 75 | }; |
| @@ -76,8 +77,10 @@ struct nf_conntrack_l3proto { | |||
| 76 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; | 77 | extern struct nf_conntrack_l3proto __rcu *nf_ct_l3protos[AF_MAX]; |
| 77 | 78 | ||
| 78 | /* Protocol registration. */ | 79 | /* Protocol registration. */ |
| 79 | extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); | 80 | extern int nf_conntrack_l3proto_register(struct net *net, |
| 80 | extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); | 81 | struct nf_conntrack_l3proto *proto); |
| 82 | extern void nf_conntrack_l3proto_unregister(struct net *net, | ||
| 83 | struct nf_conntrack_l3proto *proto); | ||
| 81 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); | 84 | extern struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); |
| 82 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); | 85 | extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); |
| 83 | 86 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 3b572bb20aa2..c3be4aef6bf7 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/netlink.h> | 12 | #include <linux/netlink.h> |
| 13 | #include <net/netlink.h> | 13 | #include <net/netlink.h> |
| 14 | #include <net/netfilter/nf_conntrack.h> | 14 | #include <net/netfilter/nf_conntrack.h> |
| 15 | #include <net/netns/generic.h> | ||
| 15 | 16 | ||
| 16 | struct seq_file; | 17 | struct seq_file; |
| 17 | 18 | ||
| @@ -86,23 +87,21 @@ struct nf_conntrack_l4proto { | |||
| 86 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) | 87 | #if IS_ENABLED(CONFIG_NF_CT_NETLINK_TIMEOUT) |
| 87 | struct { | 88 | struct { |
| 88 | size_t obj_size; | 89 | size_t obj_size; |
| 89 | int (*nlattr_to_obj)(struct nlattr *tb[], void *data); | 90 | int (*nlattr_to_obj)(struct nlattr *tb[], |
| 91 | struct net *net, void *data); | ||
| 90 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); | 92 | int (*obj_to_nlattr)(struct sk_buff *skb, const void *data); |
| 91 | 93 | ||
| 92 | unsigned int nlattr_max; | 94 | unsigned int nlattr_max; |
| 93 | const struct nla_policy *nla_policy; | 95 | const struct nla_policy *nla_policy; |
| 94 | } ctnl_timeout; | 96 | } ctnl_timeout; |
| 95 | #endif | 97 | #endif |
| 98 | int *net_id; | ||
| 99 | /* Init l4proto pernet data */ | ||
| 100 | int (*init_net)(struct net *net, u_int16_t proto); | ||
| 101 | |||
| 102 | /* Return the per-net protocol part. */ | ||
| 103 | struct nf_proto_net *(*get_net_proto)(struct net *net); | ||
| 96 | 104 | ||
| 97 | #ifdef CONFIG_SYSCTL | ||
| 98 | struct ctl_table_header **ctl_table_header; | ||
| 99 | struct ctl_table *ctl_table; | ||
| 100 | unsigned int *ctl_table_users; | ||
| 101 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
| 102 | struct ctl_table_header *ctl_compat_table_header; | ||
| 103 | struct ctl_table *ctl_compat_table; | ||
| 104 | #endif | ||
| 105 | #endif | ||
| 106 | /* Protocol name */ | 105 | /* Protocol name */ |
| 107 | const char *name; | 106 | const char *name; |
| 108 | 107 | ||
| @@ -123,8 +122,18 @@ nf_ct_l4proto_find_get(u_int16_t l3proto, u_int8_t l4proto); | |||
| 123 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); | 122 | extern void nf_ct_l4proto_put(struct nf_conntrack_l4proto *p); |
| 124 | 123 | ||
| 125 | /* Protocol registration. */ | 124 | /* Protocol registration. */ |
| 126 | extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto); | 125 | extern int nf_conntrack_l4proto_register(struct net *net, |
| 127 | extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto); | 126 | struct nf_conntrack_l4proto *proto); |
| 127 | extern void nf_conntrack_l4proto_unregister(struct net *net, | ||
| 128 | struct nf_conntrack_l4proto *proto); | ||
| 129 | |||
| 130 | static inline void nf_ct_kfree_compat_sysctl_table(struct nf_proto_net *pn) | ||
| 131 | { | ||
| 132 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) | ||
| 133 | kfree(pn->ctl_compat_table); | ||
| 134 | pn->ctl_compat_table = NULL; | ||
| 135 | #endif | ||
| 136 | } | ||
| 128 | 137 | ||
| 129 | /* Generic netlink helpers */ | 138 | /* Generic netlink helpers */ |
| 130 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | 139 | extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, |
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h index 02bb6c29dc3d..7d8fb7b46c44 100644 --- a/include/net/netfilter/nf_nat_helper.h +++ b/include/net/netfilter/nf_nat_helper.h | |||
| @@ -54,4 +54,8 @@ extern void nf_nat_follow_master(struct nf_conn *ct, | |||
| 54 | extern s16 nf_nat_get_offset(const struct nf_conn *ct, | 54 | extern s16 nf_nat_get_offset(const struct nf_conn *ct, |
| 55 | enum ip_conntrack_dir dir, | 55 | enum ip_conntrack_dir dir, |
| 56 | u32 seq); | 56 | u32 seq); |
| 57 | |||
| 58 | extern void nf_nat_tcp_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
| 59 | u32 dir, int off); | ||
| 60 | |||
| 57 | #endif | 61 | #endif |
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h new file mode 100644 index 000000000000..86267a529514 --- /dev/null +++ b/include/net/netfilter/nfnetlink_queue.h | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | #ifndef _NET_NFNL_QUEUE_H_ | ||
| 2 | #define _NET_NFNL_QUEUE_H_ | ||
| 3 | |||
| 4 | #include <linux/netfilter/nf_conntrack_common.h> | ||
| 5 | |||
| 6 | struct nf_conn; | ||
| 7 | |||
| 8 | #ifdef CONFIG_NETFILTER_NETLINK_QUEUE_CT | ||
| 9 | struct nf_conn *nfqnl_ct_get(struct sk_buff *entskb, size_t *size, | ||
| 10 | enum ip_conntrack_info *ctinfo); | ||
| 11 | struct nf_conn *nfqnl_ct_parse(const struct sk_buff *skb, | ||
| 12 | const struct nlattr *attr, | ||
| 13 | enum ip_conntrack_info *ctinfo); | ||
| 14 | int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct, | ||
| 15 | enum ip_conntrack_info ctinfo); | ||
| 16 | void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
| 17 | enum ip_conntrack_info ctinfo, int diff); | ||
| 18 | #else | ||
| 19 | inline struct nf_conn * | ||
| 20 | nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo) | ||
| 21 | { | ||
| 22 | return NULL; | ||
| 23 | } | ||
| 24 | |||
| 25 | inline struct nf_conn *nfqnl_ct_parse(const struct sk_buff *skb, | ||
| 26 | const struct nlattr *attr, | ||
| 27 | enum ip_conntrack_info *ctinfo) | ||
| 28 | { | ||
| 29 | return NULL; | ||
| 30 | } | ||
| 31 | |||
| 32 | inline int | ||
| 33 | nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info ctinfo) | ||
| 34 | { | ||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | |||
| 38 | inline void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, | ||
| 39 | enum ip_conntrack_info ctinfo, int diff) | ||
| 40 | { | ||
| 41 | } | ||
| 42 | #endif /* NF_CONNTRACK */ | ||
| 43 | #endif | ||
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index a053a19870cf..3aecdc7a84fb 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h | |||
| @@ -4,10 +4,64 @@ | |||
| 4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
| 5 | #include <linux/list_nulls.h> | 5 | #include <linux/list_nulls.h> |
| 6 | #include <linux/atomic.h> | 6 | #include <linux/atomic.h> |
| 7 | #include <linux/netfilter/nf_conntrack_tcp.h> | ||
| 7 | 8 | ||
| 8 | struct ctl_table_header; | 9 | struct ctl_table_header; |
| 9 | struct nf_conntrack_ecache; | 10 | struct nf_conntrack_ecache; |
| 10 | 11 | ||
| 12 | struct nf_proto_net { | ||
| 13 | #ifdef CONFIG_SYSCTL | ||
| 14 | struct ctl_table_header *ctl_table_header; | ||
| 15 | struct ctl_table *ctl_table; | ||
| 16 | #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT | ||
| 17 | struct ctl_table_header *ctl_compat_header; | ||
| 18 | struct ctl_table *ctl_compat_table; | ||
| 19 | #endif | ||
| 20 | #endif | ||
| 21 | unsigned int users; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct nf_generic_net { | ||
| 25 | struct nf_proto_net pn; | ||
| 26 | unsigned int timeout; | ||
| 27 | }; | ||
| 28 | |||
| 29 | struct nf_tcp_net { | ||
| 30 | struct nf_proto_net pn; | ||
| 31 | unsigned int timeouts[TCP_CONNTRACK_TIMEOUT_MAX]; | ||
| 32 | unsigned int tcp_loose; | ||
| 33 | unsigned int tcp_be_liberal; | ||
| 34 | unsigned int tcp_max_retrans; | ||
| 35 | }; | ||
| 36 | |||
| 37 | enum udp_conntrack { | ||
| 38 | UDP_CT_UNREPLIED, | ||
| 39 | UDP_CT_REPLIED, | ||
| 40 | UDP_CT_MAX | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct nf_udp_net { | ||
| 44 | struct nf_proto_net pn; | ||
| 45 | unsigned int timeouts[UDP_CT_MAX]; | ||
| 46 | }; | ||
| 47 | |||
| 48 | struct nf_icmp_net { | ||
| 49 | struct nf_proto_net pn; | ||
| 50 | unsigned int timeout; | ||
| 51 | }; | ||
| 52 | |||
| 53 | struct nf_ip_net { | ||
| 54 | struct nf_generic_net generic; | ||
| 55 | struct nf_tcp_net tcp; | ||
| 56 | struct nf_udp_net udp; | ||
| 57 | struct nf_icmp_net icmp; | ||
| 58 | struct nf_icmp_net icmpv6; | ||
| 59 | #if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT) | ||
| 60 | struct ctl_table_header *ctl_table_header; | ||
| 61 | struct ctl_table *ctl_table; | ||
| 62 | #endif | ||
| 63 | }; | ||
| 64 | |||
| 11 | struct netns_ct { | 65 | struct netns_ct { |
| 12 | atomic_t count; | 66 | atomic_t count; |
| 13 | unsigned int expect_count; | 67 | unsigned int expect_count; |
| @@ -28,6 +82,7 @@ struct netns_ct { | |||
| 28 | unsigned int sysctl_log_invalid; /* Log invalid packets */ | 82 | unsigned int sysctl_log_invalid; /* Log invalid packets */ |
| 29 | int sysctl_auto_assign_helper; | 83 | int sysctl_auto_assign_helper; |
| 30 | bool auto_assign_helper_warned; | 84 | bool auto_assign_helper_warned; |
| 85 | struct nf_ip_net nf_ct_proto; | ||
| 31 | #ifdef CONFIG_SYSCTL | 86 | #ifdef CONFIG_SYSCTL |
| 32 | struct ctl_table_header *sysctl_header; | 87 | struct ctl_table_header *sysctl_header; |
| 33 | struct ctl_table_header *acct_sysctl_header; | 88 | struct ctl_table_header *acct_sysctl_header; |
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index bbd023a1c9b9..0ffb8e31f3cd 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h | |||
| @@ -7,10 +7,12 @@ | |||
| 7 | 7 | ||
| 8 | #include <net/inet_frag.h> | 8 | #include <net/inet_frag.h> |
| 9 | 9 | ||
| 10 | struct tcpm_hash_bucket; | ||
| 10 | struct ctl_table_header; | 11 | struct ctl_table_header; |
| 11 | struct ipv4_devconf; | 12 | struct ipv4_devconf; |
| 12 | struct fib_rules_ops; | 13 | struct fib_rules_ops; |
| 13 | struct hlist_head; | 14 | struct hlist_head; |
| 15 | struct fib_table; | ||
| 14 | struct sock; | 16 | struct sock; |
| 15 | 17 | ||
| 16 | struct netns_ipv4 { | 18 | struct netns_ipv4 { |
| @@ -24,13 +26,21 @@ struct netns_ipv4 { | |||
| 24 | struct ipv4_devconf *devconf_dflt; | 26 | struct ipv4_devconf *devconf_dflt; |
| 25 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 27 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
| 26 | struct fib_rules_ops *rules_ops; | 28 | struct fib_rules_ops *rules_ops; |
| 29 | bool fib_has_custom_rules; | ||
| 30 | struct fib_table *fib_local; | ||
| 31 | struct fib_table *fib_main; | ||
| 32 | struct fib_table *fib_default; | ||
| 33 | #endif | ||
| 34 | #ifdef CONFIG_IP_ROUTE_CLASSID | ||
| 35 | int fib_num_tclassid_users; | ||
| 27 | #endif | 36 | #endif |
| 28 | struct hlist_head *fib_table_hash; | 37 | struct hlist_head *fib_table_hash; |
| 29 | struct sock *fibnl; | 38 | struct sock *fibnl; |
| 30 | 39 | ||
| 31 | struct sock **icmp_sk; | 40 | struct sock **icmp_sk; |
| 32 | struct sock *tcp_sock; | 41 | struct inet_peer_base *peers; |
| 33 | 42 | struct tcpm_hash_bucket *tcp_metrics_hash; | |
| 43 | unsigned int tcp_metrics_hash_log; | ||
| 34 | struct netns_frags frags; | 44 | struct netns_frags frags; |
| 35 | #ifdef CONFIG_NETFILTER | 45 | #ifdef CONFIG_NETFILTER |
| 36 | struct xt_table *iptable_filter; | 46 | struct xt_table *iptable_filter; |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index b42be53587ba..df0a5456a3fd 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -33,6 +33,7 @@ struct netns_ipv6 { | |||
| 33 | struct netns_sysctl_ipv6 sysctl; | 33 | struct netns_sysctl_ipv6 sysctl; |
| 34 | struct ipv6_devconf *devconf_all; | 34 | struct ipv6_devconf *devconf_all; |
| 35 | struct ipv6_devconf *devconf_dflt; | 35 | struct ipv6_devconf *devconf_dflt; |
| 36 | struct inet_peer_base *peers; | ||
| 36 | struct netns_frags frags; | 37 | struct netns_frags frags; |
| 37 | #ifdef CONFIG_NETFILTER | 38 | #ifdef CONFIG_NETFILTER |
| 38 | struct xt_table *ip6table_filter; | 39 | struct xt_table *ip6table_filter; |
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h index d58fdec47597..2719dec6b5a8 100644 --- a/include/net/netprio_cgroup.h +++ b/include/net/netprio_cgroup.h | |||
| @@ -35,7 +35,7 @@ struct cgroup_netprio_state { | |||
| 35 | extern int net_prio_subsys_id; | 35 | extern int net_prio_subsys_id; |
| 36 | #endif | 36 | #endif |
| 37 | 37 | ||
| 38 | extern void sock_update_netprioidx(struct sock *sk); | 38 | extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); |
| 39 | 39 | ||
| 40 | #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) | 40 | #if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) |
| 41 | 41 | ||
| @@ -82,7 +82,7 @@ static inline u32 task_netprioidx(struct task_struct *p) | |||
| 82 | #endif /* CONFIG_NETPRIO_CGROUP */ | 82 | #endif /* CONFIG_NETPRIO_CGROUP */ |
| 83 | 83 | ||
| 84 | #else | 84 | #else |
| 85 | #define sock_update_netprioidx(sk) | 85 | #define sock_update_netprioidx(sk, task) |
| 86 | #endif | 86 | #endif |
| 87 | 87 | ||
| 88 | #endif /* _NET_CLS_CGROUP_H */ | 88 | #endif /* _NET_CLS_CGROUP_H */ |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 4467c9460857..f5169b04f082 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
| @@ -31,7 +31,8 @@ struct nfc_hci_ops { | |||
| 31 | void (*close) (struct nfc_hci_dev *hdev); | 31 | void (*close) (struct nfc_hci_dev *hdev); |
| 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); | 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); |
| 33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
| 34 | int (*start_poll) (struct nfc_hci_dev *hdev, u32 protocols); | 34 | int (*start_poll) (struct nfc_hci_dev *hdev, |
| 35 | u32 im_protocols, u32 tm_protocols); | ||
| 35 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 36 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
| 36 | struct nfc_target *target); | 37 | struct nfc_target *target); |
| 37 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
| @@ -43,10 +44,20 @@ struct nfc_hci_ops { | |||
| 43 | struct nfc_target *target); | 44 | struct nfc_target *target); |
| 44 | }; | 45 | }; |
| 45 | 46 | ||
| 46 | #define NFC_HCI_MAX_CUSTOM_GATES 15 | 47 | /* Pipes */ |
| 48 | #define NFC_HCI_INVALID_PIPE 0x80 | ||
| 49 | #define NFC_HCI_LINK_MGMT_PIPE 0x00 | ||
| 50 | #define NFC_HCI_ADMIN_PIPE 0x01 | ||
| 51 | |||
| 52 | struct nfc_hci_gate { | ||
| 53 | u8 gate; | ||
| 54 | u8 pipe; | ||
| 55 | }; | ||
| 56 | |||
| 57 | #define NFC_HCI_MAX_CUSTOM_GATES 50 | ||
| 47 | struct nfc_hci_init_data { | 58 | struct nfc_hci_init_data { |
| 48 | u8 gate_count; | 59 | u8 gate_count; |
| 49 | u8 gates[NFC_HCI_MAX_CUSTOM_GATES]; | 60 | struct nfc_hci_gate gates[NFC_HCI_MAX_CUSTOM_GATES]; |
| 50 | char session_id[9]; | 61 | char session_id[9]; |
| 51 | }; | 62 | }; |
| 52 | 63 | ||
| @@ -111,6 +122,8 @@ void nfc_hci_unregister_device(struct nfc_hci_dev *hdev); | |||
| 111 | void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata); | 122 | void nfc_hci_set_clientdata(struct nfc_hci_dev *hdev, void *clientdata); |
| 112 | void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | 123 | void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); |
| 113 | 124 | ||
| 125 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | ||
| 126 | |||
| 114 | /* Host IDs */ | 127 | /* Host IDs */ |
| 115 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 128 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
| 116 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 129 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
| @@ -179,7 +192,8 @@ void nfc_hci_event_received(struct nfc_hci_dev *hdev, u8 pipe, u8 event, | |||
| 179 | void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb); | 192 | void nfc_hci_recv_frame(struct nfc_hci_dev *hdev, struct sk_buff *skb); |
| 180 | 193 | ||
| 181 | /* connecting to gates and sending hci instructions */ | 194 | /* connecting to gates and sending hci instructions */ |
| 182 | int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate); | 195 | int nfc_hci_connect_gate(struct nfc_hci_dev *hdev, u8 dest_host, u8 dest_gate, |
| 196 | u8 pipe); | ||
| 183 | int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate); | 197 | int nfc_hci_disconnect_gate(struct nfc_hci_dev *hdev, u8 gate); |
| 184 | int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev); | 198 | int nfc_hci_disconnect_all_gates(struct nfc_hci_dev *hdev); |
| 185 | int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, | 199 | int nfc_hci_get_param(struct nfc_hci_dev *hdev, u8 gate, u8 idx, |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index b7ca4a2a1d72..6431f5e39022 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -53,7 +53,8 @@ struct nfc_target; | |||
| 53 | struct nfc_ops { | 53 | struct nfc_ops { |
| 54 | int (*dev_up)(struct nfc_dev *dev); | 54 | int (*dev_up)(struct nfc_dev *dev); |
| 55 | int (*dev_down)(struct nfc_dev *dev); | 55 | int (*dev_down)(struct nfc_dev *dev); |
| 56 | int (*start_poll)(struct nfc_dev *dev, u32 protocols); | 56 | int (*start_poll)(struct nfc_dev *dev, |
| 57 | u32 im_protocols, u32 tm_protocols); | ||
| 57 | void (*stop_poll)(struct nfc_dev *dev); | 58 | void (*stop_poll)(struct nfc_dev *dev); |
| 58 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, | 59 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, |
| 59 | u8 comm_mode, u8 *gb, size_t gb_len); | 60 | u8 comm_mode, u8 *gb, size_t gb_len); |
| @@ -62,9 +63,10 @@ struct nfc_ops { | |||
| 62 | u32 protocol); | 63 | u32 protocol); |
| 63 | void (*deactivate_target)(struct nfc_dev *dev, | 64 | void (*deactivate_target)(struct nfc_dev *dev, |
| 64 | struct nfc_target *target); | 65 | struct nfc_target *target); |
| 65 | int (*data_exchange)(struct nfc_dev *dev, struct nfc_target *target, | 66 | int (*im_transceive)(struct nfc_dev *dev, struct nfc_target *target, |
| 66 | struct sk_buff *skb, data_exchange_cb_t cb, | 67 | struct sk_buff *skb, data_exchange_cb_t cb, |
| 67 | void *cb_context); | 68 | void *cb_context); |
| 69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); | ||
| 68 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); | 70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); |
| 69 | }; | 71 | }; |
| 70 | 72 | ||
| @@ -99,10 +101,10 @@ struct nfc_dev { | |||
| 99 | int targets_generation; | 101 | int targets_generation; |
| 100 | struct device dev; | 102 | struct device dev; |
| 101 | bool dev_up; | 103 | bool dev_up; |
| 104 | u8 rf_mode; | ||
| 102 | bool polling; | 105 | bool polling; |
| 103 | struct nfc_target *active_target; | 106 | struct nfc_target *active_target; |
| 104 | bool dep_link_up; | 107 | bool dep_link_up; |
| 105 | u32 dep_rf_mode; | ||
| 106 | struct nfc_genl_data genl_data; | 108 | struct nfc_genl_data genl_data; |
| 107 | u32 supported_protocols; | 109 | u32 supported_protocols; |
| 108 | 110 | ||
| @@ -188,6 +190,7 @@ struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp); | |||
| 188 | 190 | ||
| 189 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, | 191 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, |
| 190 | u8 *gt, u8 gt_len); | 192 | u8 *gt, u8 gt_len); |
| 193 | u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); | ||
| 191 | 194 | ||
| 192 | int nfc_targets_found(struct nfc_dev *dev, | 195 | int nfc_targets_found(struct nfc_dev *dev, |
| 193 | struct nfc_target *targets, int ntargets); | 196 | struct nfc_target *targets, int ntargets); |
| @@ -196,4 +199,11 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); | |||
| 196 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, | 199 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, |
| 197 | u8 comm_mode, u8 rf_mode); | 200 | u8 comm_mode, u8 rf_mode); |
| 198 | 201 | ||
| 202 | int nfc_tm_activated(struct nfc_dev *dev, u32 protocol, u8 comm_mode, | ||
| 203 | u8 *gb, size_t gb_len); | ||
| 204 | int nfc_tm_deactivated(struct nfc_dev *dev); | ||
| 205 | int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); | ||
| 206 | |||
| 207 | void nfc_driver_failure(struct nfc_dev *dev, int err); | ||
| 208 | |||
| 199 | #endif /* __NET_NFC_H */ | 209 | #endif /* __NET_NFC_H */ |
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h index ab06afd462da..35e930d2f638 100644 --- a/include/net/nfc/shdlc.h +++ b/include/net/nfc/shdlc.h | |||
| @@ -27,7 +27,8 @@ struct nfc_shdlc_ops { | |||
| 27 | void (*close) (struct nfc_shdlc *shdlc); | 27 | void (*close) (struct nfc_shdlc *shdlc); |
| 28 | int (*hci_ready) (struct nfc_shdlc *shdlc); | 28 | int (*hci_ready) (struct nfc_shdlc *shdlc); |
| 29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); | 29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); |
| 30 | int (*start_poll) (struct nfc_shdlc *shdlc, u32 protocols); | 30 | int (*start_poll) (struct nfc_shdlc *shdlc, |
| 31 | u32 im_protocols, u32 tm_protocols); | ||
| 31 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, | 32 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, |
| 32 | struct nfc_target *target); | 33 | struct nfc_target *target); |
| 33 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | 34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 875f4895b033..057f2d315567 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
| @@ -29,11 +29,15 @@ | |||
| 29 | #include <linux/ipv6.h> | 29 | #include <linux/ipv6.h> |
| 30 | #endif | 30 | #endif |
| 31 | 31 | ||
| 32 | #define MAX_INET_PROTOS 256 /* Must be a power of 2 */ | 32 | /* This is one larger than the largest protocol value that can be |
| 33 | 33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | |
| 34 | * value is presented in a __u8, this is defined to be 256. | ||
| 35 | */ | ||
| 36 | #define MAX_INET_PROTOS 256 | ||
| 34 | 37 | ||
| 35 | /* This is used to register protocols. */ | 38 | /* This is used to register protocols. */ |
| 36 | struct net_protocol { | 39 | struct net_protocol { |
| 40 | void (*early_demux)(struct sk_buff *skb); | ||
| 37 | int (*handler)(struct sk_buff *skb); | 41 | int (*handler)(struct sk_buff *skb); |
| 38 | void (*err_handler)(struct sk_buff *skb, u32 info); | 42 | void (*err_handler)(struct sk_buff *skb, u32 info); |
| 39 | int (*gso_send_check)(struct sk_buff *skb); | 43 | int (*gso_send_check)(struct sk_buff *skb); |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index a5f79933e211..7dcaa2794fde 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
| @@ -52,6 +52,10 @@ enum environment_cap { | |||
| 52 | * DFS master operation on a known DFS region (NL80211_DFS_*), | 52 | * DFS master operation on a known DFS region (NL80211_DFS_*), |
| 53 | * dfs_region represents that region. Drivers can use this and the | 53 | * dfs_region represents that region. Drivers can use this and the |
| 54 | * @alpha2 to adjust their device's DFS parameters as required. | 54 | * @alpha2 to adjust their device's DFS parameters as required. |
| 55 | * @user_reg_hint_type: if the @initiator was of type | ||
| 56 | * %NL80211_REGDOM_SET_BY_USER, this classifies the type | ||
| 57 | * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* | ||
| 58 | * types. | ||
| 55 | * @intersect: indicates whether the wireless core should intersect | 59 | * @intersect: indicates whether the wireless core should intersect |
| 56 | * the requested regulatory domain with the presently set regulatory | 60 | * the requested regulatory domain with the presently set regulatory |
| 57 | * domain. | 61 | * domain. |
| @@ -70,6 +74,7 @@ enum environment_cap { | |||
| 70 | struct regulatory_request { | 74 | struct regulatory_request { |
| 71 | int wiphy_idx; | 75 | int wiphy_idx; |
| 72 | enum nl80211_reg_initiator initiator; | 76 | enum nl80211_reg_initiator initiator; |
| 77 | enum nl80211_user_reg_hint_type user_reg_hint_type; | ||
| 73 | char alpha2[2]; | 78 | char alpha2[2]; |
| 74 | u8 dfs_region; | 79 | u8 dfs_region; |
| 75 | bool intersect; | 80 | bool intersect; |
diff --git a/include/net/route.h b/include/net/route.h index 98705468ac03..c29ef2733f2d 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -40,45 +40,39 @@ | |||
| 40 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) | 40 | #define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) |
| 41 | 41 | ||
| 42 | struct fib_nh; | 42 | struct fib_nh; |
| 43 | struct inet_peer; | ||
| 44 | struct fib_info; | 43 | struct fib_info; |
| 45 | struct rtable { | 44 | struct rtable { |
| 46 | struct dst_entry dst; | 45 | struct dst_entry dst; |
| 47 | 46 | ||
| 48 | /* Lookup key. */ | ||
| 49 | __be32 rt_key_dst; | ||
| 50 | __be32 rt_key_src; | ||
| 51 | |||
| 52 | int rt_genid; | 47 | int rt_genid; |
| 53 | unsigned int rt_flags; | 48 | unsigned int rt_flags; |
| 54 | __u16 rt_type; | 49 | __u16 rt_type; |
| 55 | __u8 rt_key_tos; | 50 | __u16 rt_is_input; |
| 56 | 51 | ||
| 57 | __be32 rt_dst; /* Path destination */ | ||
| 58 | __be32 rt_src; /* Path source */ | ||
| 59 | int rt_route_iif; | ||
| 60 | int rt_iif; | 52 | int rt_iif; |
| 61 | int rt_oif; | ||
| 62 | __u32 rt_mark; | ||
| 63 | 53 | ||
| 64 | /* Info on neighbour */ | 54 | /* Info on neighbour */ |
| 65 | __be32 rt_gateway; | 55 | __be32 rt_gateway; |
| 66 | 56 | ||
| 67 | /* Miscellaneous cached information */ | 57 | /* Miscellaneous cached information */ |
| 68 | __be32 rt_spec_dst; /* RFC1122 specific destination */ | 58 | u32 rt_pmtu; |
| 69 | u32 rt_peer_genid; | ||
| 70 | struct inet_peer *peer; /* long-living peer info */ | ||
| 71 | struct fib_info *fi; /* for client ref to shared metrics */ | ||
| 72 | }; | 59 | }; |
| 73 | 60 | ||
| 74 | static inline bool rt_is_input_route(const struct rtable *rt) | 61 | static inline bool rt_is_input_route(const struct rtable *rt) |
| 75 | { | 62 | { |
| 76 | return rt->rt_route_iif != 0; | 63 | return rt->rt_is_input != 0; |
| 77 | } | 64 | } |
| 78 | 65 | ||
| 79 | static inline bool rt_is_output_route(const struct rtable *rt) | 66 | static inline bool rt_is_output_route(const struct rtable *rt) |
| 80 | { | 67 | { |
| 81 | return rt->rt_route_iif == 0; | 68 | return rt->rt_is_input == 0; |
| 69 | } | ||
| 70 | |||
| 71 | static inline __be32 rt_nexthop(const struct rtable *rt, __be32 daddr) | ||
| 72 | { | ||
| 73 | if (rt->rt_gateway) | ||
| 74 | return rt->rt_gateway; | ||
| 75 | return daddr; | ||
| 82 | } | 76 | } |
| 83 | 77 | ||
| 84 | struct ip_rt_acct { | 78 | struct ip_rt_acct { |
| @@ -111,10 +105,7 @@ extern struct ip_rt_acct __percpu *ip_rt_acct; | |||
| 111 | 105 | ||
| 112 | struct in_device; | 106 | struct in_device; |
| 113 | extern int ip_rt_init(void); | 107 | extern int ip_rt_init(void); |
| 114 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | ||
| 115 | __be32 src, struct net_device *dev); | ||
| 116 | extern void rt_cache_flush(struct net *net, int how); | 108 | extern void rt_cache_flush(struct net *net, int how); |
| 117 | extern void rt_cache_flush_batch(struct net *net); | ||
| 118 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); | 109 | extern struct rtable *__ip_route_output_key(struct net *, struct flowi4 *flp); |
| 119 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, | 110 | extern struct rtable *ip_route_output_flow(struct net *, struct flowi4 *flp, |
| 120 | struct sock *sk); | 111 | struct sock *sk); |
| @@ -166,24 +157,16 @@ static inline struct rtable *ip_route_output_gre(struct net *net, struct flowi4 | |||
| 166 | return ip_route_output_key(net, fl4); | 157 | return ip_route_output_key(net, fl4); |
| 167 | } | 158 | } |
| 168 | 159 | ||
| 169 | extern int ip_route_input_common(struct sk_buff *skb, __be32 dst, __be32 src, | 160 | extern int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, |
| 170 | u8 tos, struct net_device *devin, bool noref); | 161 | u8 tos, struct net_device *devin); |
| 171 | |||
| 172 | static inline int ip_route_input(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 173 | u8 tos, struct net_device *devin) | ||
| 174 | { | ||
| 175 | return ip_route_input_common(skb, dst, src, tos, devin, false); | ||
| 176 | } | ||
| 177 | |||
| 178 | static inline int ip_route_input_noref(struct sk_buff *skb, __be32 dst, __be32 src, | ||
| 179 | u8 tos, struct net_device *devin) | ||
| 180 | { | ||
| 181 | return ip_route_input_common(skb, dst, src, tos, devin, true); | ||
| 182 | } | ||
| 183 | 162 | ||
| 184 | extern unsigned short ip_rt_frag_needed(struct net *net, const struct iphdr *iph, | 163 | extern void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu, |
| 185 | unsigned short new_mtu, struct net_device *dev); | 164 | int oif, u32 mark, u8 protocol, int flow_flags); |
| 186 | extern void ip_rt_send_redirect(struct sk_buff *skb); | 165 | extern void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu); |
| 166 | extern void ipv4_redirect(struct sk_buff *skb, struct net *net, | ||
| 167 | int oif, u32 mark, u8 protocol, int flow_flags); | ||
| 168 | extern void ipv4_sk_redirect(struct sk_buff *skb, struct sock *sk); | ||
| 169 | extern void ip_rt_send_redirect(struct sk_buff *skb); | ||
| 187 | 170 | ||
| 188 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); | 171 | extern unsigned int inet_addr_type(struct net *net, __be32 addr); |
| 189 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); | 172 | extern unsigned int inet_dev_addr_type(struct net *net, const struct net_device *dev, __be32 addr); |
| @@ -244,8 +227,6 @@ static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 | |||
| 244 | 227 | ||
| 245 | if (inet_sk(sk)->transparent) | 228 | if (inet_sk(sk)->transparent) |
| 246 | flow_flags |= FLOWI_FLAG_ANYSRC; | 229 | flow_flags |= FLOWI_FLAG_ANYSRC; |
| 247 | if (protocol == IPPROTO_TCP) | ||
| 248 | flow_flags |= FLOWI_FLAG_PRECOW_METRICS; | ||
| 249 | if (can_sleep) | 230 | if (can_sleep) |
| 250 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; | 231 | flow_flags |= FLOWI_FLAG_CAN_SLEEP; |
| 251 | 232 | ||
| @@ -294,20 +275,13 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable | |||
| 294 | return rt; | 275 | return rt; |
| 295 | } | 276 | } |
| 296 | 277 | ||
| 297 | extern void rt_bind_peer(struct rtable *rt, __be32 daddr, int create); | ||
| 298 | |||
| 299 | static inline struct inet_peer *rt_get_peer(struct rtable *rt, __be32 daddr) | ||
| 300 | { | ||
| 301 | if (rt->peer) | ||
| 302 | return rt->peer; | ||
| 303 | |||
| 304 | rt_bind_peer(rt, daddr, 0); | ||
| 305 | return rt->peer; | ||
| 306 | } | ||
| 307 | |||
| 308 | static inline int inet_iif(const struct sk_buff *skb) | 278 | static inline int inet_iif(const struct sk_buff *skb) |
| 309 | { | 279 | { |
| 310 | return skb_rtable(skb)->rt_iif; | 280 | int iif = skb_rtable(skb)->rt_iif; |
| 281 | |||
| 282 | if (iif) | ||
| 283 | return iif; | ||
| 284 | return skb->skb_iif; | ||
| 311 | } | 285 | } |
| 312 | 286 | ||
| 313 | extern int sysctl_ip_default_ttl; | 287 | extern int sysctl_ip_default_ttl; |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index bbcfd0993432..6b00c4fc4291 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -44,8 +44,10 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) | |||
| 44 | * @get_xstats_size: Function to calculate required room for dumping device | 44 | * @get_xstats_size: Function to calculate required room for dumping device |
| 45 | * specific statistics | 45 | * specific statistics |
| 46 | * @fill_xstats: Function to dump device specific statistics | 46 | * @fill_xstats: Function to dump device specific statistics |
| 47 | * @get_tx_queues: Function to determine number of transmit queues to create when | 47 | * @get_num_tx_queues: Function to determine number of transmit queues |
| 48 | * creating a new device. | 48 | * to create when creating a new device. |
| 49 | * @get_num_rx_queues: Function to determine number of receive queues | ||
| 50 | * to create when creating a new device. | ||
| 49 | */ | 51 | */ |
| 50 | struct rtnl_link_ops { | 52 | struct rtnl_link_ops { |
| 51 | struct list_head list; | 53 | struct list_head list; |
| @@ -77,8 +79,8 @@ struct rtnl_link_ops { | |||
| 77 | size_t (*get_xstats_size)(const struct net_device *dev); | 79 | size_t (*get_xstats_size)(const struct net_device *dev); |
| 78 | int (*fill_xstats)(struct sk_buff *skb, | 80 | int (*fill_xstats)(struct sk_buff *skb, |
| 79 | const struct net_device *dev); | 81 | const struct net_device *dev); |
| 80 | int (*get_tx_queues)(struct net *net, | 82 | unsigned int (*get_num_tx_queues)(void); |
| 81 | struct nlattr *tb[]); | 83 | unsigned int (*get_num_rx_queues)(void); |
| 82 | }; | 84 | }; |
| 83 | 85 | ||
| 84 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | 86 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 9d7d54a00e63..d9611e032418 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -220,7 +220,7 @@ struct tcf_proto { | |||
| 220 | 220 | ||
| 221 | struct qdisc_skb_cb { | 221 | struct qdisc_skb_cb { |
| 222 | unsigned int pkt_len; | 222 | unsigned int pkt_len; |
| 223 | u16 bond_queue_mapping; | 223 | u16 slave_dev_queue_mapping; |
| 224 | u16 _pad; | 224 | u16 _pad; |
| 225 | unsigned char data[20]; | 225 | unsigned char data[20]; |
| 226 | }; | 226 | }; |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 942b864f6135..d053d2e99876 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -334,6 +334,7 @@ typedef enum { | |||
| 334 | typedef enum { | 334 | typedef enum { |
| 335 | SCTP_TRANSPORT_UP, | 335 | SCTP_TRANSPORT_UP, |
| 336 | SCTP_TRANSPORT_DOWN, | 336 | SCTP_TRANSPORT_DOWN, |
| 337 | SCTP_TRANSPORT_PF, | ||
| 337 | } sctp_transport_cmd_t; | 338 | } sctp_transport_cmd_t; |
| 338 | 339 | ||
| 339 | /* These are the address scopes defined mainly for IPv4 addresses | 340 | /* These are the address scopes defined mainly for IPv4 addresses |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index a2ef81466b00..ff499640528b 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -162,6 +162,8 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *, | |||
| 162 | void sctp_err_finish(struct sock *, struct sctp_association *); | 162 | void sctp_err_finish(struct sock *, struct sctp_association *); |
| 163 | void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, | 163 | void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, |
| 164 | struct sctp_transport *t, __u32 pmtu); | 164 | struct sctp_transport *t, __u32 pmtu); |
| 165 | void sctp_icmp_redirect(struct sock *, struct sctp_transport *, | ||
| 166 | struct sk_buff *); | ||
| 165 | void sctp_icmp_proto_unreachable(struct sock *sk, | 167 | void sctp_icmp_proto_unreachable(struct sock *sk, |
| 166 | struct sctp_association *asoc, | 168 | struct sctp_association *asoc, |
| 167 | struct sctp_transport *t); | 169 | struct sctp_transport *t); |
| @@ -517,10 +519,10 @@ static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) | |||
| 517 | return frag; | 519 | return frag; |
| 518 | } | 520 | } |
| 519 | 521 | ||
| 520 | static inline void sctp_assoc_pending_pmtu(struct sctp_association *asoc) | 522 | static inline void sctp_assoc_pending_pmtu(struct sock *sk, struct sctp_association *asoc) |
| 521 | { | 523 | { |
| 522 | 524 | ||
| 523 | sctp_assoc_sync_pmtu(asoc); | 525 | sctp_assoc_sync_pmtu(sk, asoc); |
| 524 | asoc->pmtu_pending = 0; | 526 | asoc->pmtu_pending = 0; |
| 525 | } | 527 | } |
| 526 | 528 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index fecdf31816f2..fc5e60016e37 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -161,6 +161,12 @@ extern struct sctp_globals { | |||
| 161 | int max_retrans_path; | 161 | int max_retrans_path; |
| 162 | int max_retrans_init; | 162 | int max_retrans_init; |
| 163 | 163 | ||
| 164 | /* Potentially-Failed.Max.Retrans sysctl value | ||
| 165 | * taken from: | ||
| 166 | * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05 | ||
| 167 | */ | ||
| 168 | int pf_retrans; | ||
| 169 | |||
| 164 | /* | 170 | /* |
| 165 | * Policy for preforming sctp/socket accounting | 171 | * Policy for preforming sctp/socket accounting |
| 166 | * 0 - do socket level accounting, all assocs share sk_sndbuf | 172 | * 0 - do socket level accounting, all assocs share sk_sndbuf |
| @@ -258,6 +264,7 @@ extern struct sctp_globals { | |||
| 258 | #define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) | 264 | #define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) |
| 259 | #define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy) | 265 | #define sctp_rcvbuf_policy (sctp_globals.rcvbuf_policy) |
| 260 | #define sctp_max_retrans_path (sctp_globals.max_retrans_path) | 266 | #define sctp_max_retrans_path (sctp_globals.max_retrans_path) |
| 267 | #define sctp_pf_retrans (sctp_globals.pf_retrans) | ||
| 261 | #define sctp_max_retrans_init (sctp_globals.max_retrans_init) | 268 | #define sctp_max_retrans_init (sctp_globals.max_retrans_init) |
| 262 | #define sctp_sack_timeout (sctp_globals.sack_timeout) | 269 | #define sctp_sack_timeout (sctp_globals.sack_timeout) |
| 263 | #define sctp_hb_interval (sctp_globals.hb_interval) | 270 | #define sctp_hb_interval (sctp_globals.hb_interval) |
| @@ -990,10 +997,15 @@ struct sctp_transport { | |||
| 990 | 997 | ||
| 991 | /* This is the max_retrans value for the transport and will | 998 | /* This is the max_retrans value for the transport and will |
| 992 | * be initialized from the assocs value. This can be changed | 999 | * be initialized from the assocs value. This can be changed |
| 993 | * using SCTP_SET_PEER_ADDR_PARAMS socket option. | 1000 | * using the SCTP_SET_PEER_ADDR_PARAMS socket option. |
| 994 | */ | 1001 | */ |
| 995 | __u16 pathmaxrxt; | 1002 | __u16 pathmaxrxt; |
| 996 | 1003 | ||
| 1004 | /* This is the partially failed retrans value for the transport | ||
| 1005 | * and will be initialized from the assocs value. This can be changed | ||
| 1006 | * using the SCTP_PEER_ADDR_THLDS socket option | ||
| 1007 | */ | ||
| 1008 | int pf_retrans; | ||
| 997 | /* PMTU : The current known path MTU. */ | 1009 | /* PMTU : The current known path MTU. */ |
| 998 | __u32 pathmtu; | 1010 | __u32 pathmtu; |
| 999 | 1011 | ||
| @@ -1091,7 +1103,7 @@ void sctp_transport_burst_limited(struct sctp_transport *); | |||
| 1091 | void sctp_transport_burst_reset(struct sctp_transport *); | 1103 | void sctp_transport_burst_reset(struct sctp_transport *); |
| 1092 | unsigned long sctp_transport_timeout(struct sctp_transport *); | 1104 | unsigned long sctp_transport_timeout(struct sctp_transport *); |
| 1093 | void sctp_transport_reset(struct sctp_transport *); | 1105 | void sctp_transport_reset(struct sctp_transport *); |
| 1094 | void sctp_transport_update_pmtu(struct sctp_transport *, u32); | 1106 | void sctp_transport_update_pmtu(struct sock *, struct sctp_transport *, u32); |
| 1095 | void sctp_transport_immediate_rtx(struct sctp_transport *); | 1107 | void sctp_transport_immediate_rtx(struct sctp_transport *); |
| 1096 | 1108 | ||
| 1097 | 1109 | ||
| @@ -1664,6 +1676,12 @@ struct sctp_association { | |||
| 1664 | */ | 1676 | */ |
| 1665 | int max_retrans; | 1677 | int max_retrans; |
| 1666 | 1678 | ||
| 1679 | /* This is the partially failed retrans value for the transport | ||
| 1680 | * and will be initialized from the assocs value. This can be | ||
| 1681 | * changed using the SCTP_PEER_ADDR_THLDS socket option | ||
| 1682 | */ | ||
| 1683 | int pf_retrans; | ||
| 1684 | |||
| 1667 | /* Maximum number of times the endpoint will retransmit INIT */ | 1685 | /* Maximum number of times the endpoint will retransmit INIT */ |
| 1668 | __u16 max_init_attempts; | 1686 | __u16 max_init_attempts; |
| 1669 | 1687 | ||
| @@ -2003,7 +2021,7 @@ void sctp_assoc_update(struct sctp_association *old, | |||
| 2003 | 2021 | ||
| 2004 | __u32 sctp_association_get_next_tsn(struct sctp_association *); | 2022 | __u32 sctp_association_get_next_tsn(struct sctp_association *); |
| 2005 | 2023 | ||
| 2006 | void sctp_assoc_sync_pmtu(struct sctp_association *); | 2024 | void sctp_assoc_sync_pmtu(struct sock *, struct sctp_association *); |
| 2007 | void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned int); | 2025 | void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned int); |
| 2008 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned int); | 2026 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned int); |
| 2009 | void sctp_assoc_set_primary(struct sctp_association *, | 2027 | void sctp_assoc_set_primary(struct sctp_association *, |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 0842ef00b2fe..1b02d7ad453b 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
| @@ -93,6 +93,7 @@ typedef __s32 sctp_assoc_t; | |||
| 93 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ | 93 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ |
| 94 | #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ | 94 | #define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ |
| 95 | #define SCTP_AUTO_ASCONF 30 | 95 | #define SCTP_AUTO_ASCONF 30 |
| 96 | #define SCTP_PEER_ADDR_THLDS 31 | ||
| 96 | 97 | ||
| 97 | /* Internal Socket Options. Some of the sctp library functions are | 98 | /* Internal Socket Options. Some of the sctp library functions are |
| 98 | * implemented using these socket options. | 99 | * implemented using these socket options. |
| @@ -649,6 +650,7 @@ struct sctp_paddrinfo { | |||
| 649 | */ | 650 | */ |
| 650 | enum sctp_spinfo_state { | 651 | enum sctp_spinfo_state { |
| 651 | SCTP_INACTIVE, | 652 | SCTP_INACTIVE, |
| 653 | SCTP_PF, | ||
| 652 | SCTP_ACTIVE, | 654 | SCTP_ACTIVE, |
| 653 | SCTP_UNCONFIRMED, | 655 | SCTP_UNCONFIRMED, |
| 654 | SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ | 656 | SCTP_UNKNOWN = 0xffff /* Value used for transport state unknown */ |
| @@ -741,4 +743,13 @@ typedef struct { | |||
| 741 | int sd; | 743 | int sd; |
| 742 | } sctp_peeloff_arg_t; | 744 | } sctp_peeloff_arg_t; |
| 743 | 745 | ||
| 746 | /* | ||
| 747 | * Peer Address Thresholds socket option | ||
| 748 | */ | ||
| 749 | struct sctp_paddrthlds { | ||
| 750 | sctp_assoc_t spt_assoc_id; | ||
| 751 | struct sockaddr_storage spt_address; | ||
| 752 | __u16 spt_pathmaxrxt; | ||
| 753 | __u16 spt_pathpfthld; | ||
| 754 | }; | ||
| 744 | #endif /* __net_sctp_user_h__ */ | 755 | #endif /* __net_sctp_user_h__ */ |
diff --git a/include/net/sock.h b/include/net/sock.h index 4a4521699563..e067f8c18f88 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -198,6 +198,7 @@ struct cg_proto; | |||
| 198 | * @sk_lock: synchronizer | 198 | * @sk_lock: synchronizer |
| 199 | * @sk_rcvbuf: size of receive buffer in bytes | 199 | * @sk_rcvbuf: size of receive buffer in bytes |
| 200 | * @sk_wq: sock wait queue and async head | 200 | * @sk_wq: sock wait queue and async head |
| 201 | * @sk_rx_dst: receive input route used by early tcp demux | ||
| 201 | * @sk_dst_cache: destination cache | 202 | * @sk_dst_cache: destination cache |
| 202 | * @sk_dst_lock: destination cache lock | 203 | * @sk_dst_lock: destination cache lock |
| 203 | * @sk_policy: flow policy | 204 | * @sk_policy: flow policy |
| @@ -317,6 +318,7 @@ struct sock { | |||
| 317 | struct xfrm_policy *sk_policy[2]; | 318 | struct xfrm_policy *sk_policy[2]; |
| 318 | #endif | 319 | #endif |
| 319 | unsigned long sk_flags; | 320 | unsigned long sk_flags; |
| 321 | struct dst_entry *sk_rx_dst; | ||
| 320 | struct dst_entry *sk_dst_cache; | 322 | struct dst_entry *sk_dst_cache; |
| 321 | spinlock_t sk_dst_lock; | 323 | spinlock_t sk_dst_lock; |
| 322 | atomic_t sk_wmem_alloc; | 324 | atomic_t sk_wmem_alloc; |
| @@ -856,6 +858,9 @@ struct proto { | |||
| 856 | int (*backlog_rcv) (struct sock *sk, | 858 | int (*backlog_rcv) (struct sock *sk, |
| 857 | struct sk_buff *skb); | 859 | struct sk_buff *skb); |
| 858 | 860 | ||
| 861 | void (*release_cb)(struct sock *sk); | ||
| 862 | void (*mtu_reduced)(struct sock *sk); | ||
| 863 | |||
| 859 | /* Keeping track of sk's, looking them up, and port selection methods. */ | 864 | /* Keeping track of sk's, looking them up, and port selection methods. */ |
| 860 | void (*hash)(struct sock *sk); | 865 | void (*hash)(struct sock *sk); |
| 861 | void (*unhash)(struct sock *sk); | 866 | void (*unhash)(struct sock *sk); |
| @@ -1426,6 +1431,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk, | |||
| 1426 | gfp_t priority); | 1431 | gfp_t priority); |
| 1427 | extern void sock_wfree(struct sk_buff *skb); | 1432 | extern void sock_wfree(struct sk_buff *skb); |
| 1428 | extern void sock_rfree(struct sk_buff *skb); | 1433 | extern void sock_rfree(struct sk_buff *skb); |
| 1434 | extern void sock_edemux(struct sk_buff *skb); | ||
| 1429 | 1435 | ||
| 1430 | extern int sock_setsockopt(struct socket *sock, int level, | 1436 | extern int sock_setsockopt(struct socket *sock, int level, |
| 1431 | int op, char __user *optval, | 1437 | int op, char __user *optval, |
| @@ -2152,7 +2158,7 @@ static inline void sk_change_net(struct sock *sk, struct net *net) | |||
| 2152 | 2158 | ||
| 2153 | static inline struct sock *skb_steal_sock(struct sk_buff *skb) | 2159 | static inline struct sock *skb_steal_sock(struct sk_buff *skb) |
| 2154 | { | 2160 | { |
| 2155 | if (unlikely(skb->sk)) { | 2161 | if (skb->sk) { |
| 2156 | struct sock *sk = skb->sk; | 2162 | struct sock *sk = skb->sk; |
| 2157 | 2163 | ||
| 2158 | skb->destructor = NULL; | 2164 | skb->destructor = NULL; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index e79aa48d9fc1..e19124b84cd2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -170,6 +170,11 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 170 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ | 170 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ |
| 171 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ | 171 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ |
| 172 | #define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */ | 172 | #define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */ |
| 173 | #define TCPOPT_EXP 254 /* Experimental */ | ||
| 174 | /* Magic number to be after the option value for sharing TCP | ||
| 175 | * experimental options. See draft-ietf-tcpm-experimental-options-00.txt | ||
| 176 | */ | ||
| 177 | #define TCPOPT_FASTOPEN_MAGIC 0xF989 | ||
| 173 | 178 | ||
| 174 | /* | 179 | /* |
| 175 | * TCP option lengths | 180 | * TCP option lengths |
| @@ -180,6 +185,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 180 | #define TCPOLEN_SACK_PERM 2 | 185 | #define TCPOLEN_SACK_PERM 2 |
| 181 | #define TCPOLEN_TIMESTAMP 10 | 186 | #define TCPOLEN_TIMESTAMP 10 |
| 182 | #define TCPOLEN_MD5SIG 18 | 187 | #define TCPOLEN_MD5SIG 18 |
| 188 | #define TCPOLEN_EXP_FASTOPEN_BASE 4 | ||
| 183 | #define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */ | 189 | #define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */ |
| 184 | #define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */ | 190 | #define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */ |
| 185 | #define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN) | 191 | #define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN) |
| @@ -206,6 +212,10 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
| 206 | /* TCP initial congestion window as per draft-hkchu-tcpm-initcwnd-01 */ | 212 | /* TCP initial congestion window as per draft-hkchu-tcpm-initcwnd-01 */ |
| 207 | #define TCP_INIT_CWND 10 | 213 | #define TCP_INIT_CWND 10 |
| 208 | 214 | ||
| 215 | /* Bit Flags for sysctl_tcp_fastopen */ | ||
| 216 | #define TFO_CLIENT_ENABLE 1 | ||
| 217 | #define TFO_CLIENT_NO_COOKIE 4 /* Data in SYN w/o cookie option */ | ||
| 218 | |||
| 209 | extern struct inet_timewait_death_row tcp_death_row; | 219 | extern struct inet_timewait_death_row tcp_death_row; |
| 210 | 220 | ||
| 211 | /* sysctl variables for tcp */ | 221 | /* sysctl variables for tcp */ |
| @@ -222,6 +232,7 @@ extern int sysctl_tcp_retries1; | |||
| 222 | extern int sysctl_tcp_retries2; | 232 | extern int sysctl_tcp_retries2; |
| 223 | extern int sysctl_tcp_orphan_retries; | 233 | extern int sysctl_tcp_orphan_retries; |
| 224 | extern int sysctl_tcp_syncookies; | 234 | extern int sysctl_tcp_syncookies; |
| 235 | extern int sysctl_tcp_fastopen; | ||
| 225 | extern int sysctl_tcp_retrans_collapse; | 236 | extern int sysctl_tcp_retrans_collapse; |
| 226 | extern int sysctl_tcp_stdurg; | 237 | extern int sysctl_tcp_stdurg; |
| 227 | extern int sysctl_tcp_rfc1337; | 238 | extern int sysctl_tcp_rfc1337; |
| @@ -253,6 +264,8 @@ extern int sysctl_tcp_cookie_size; | |||
| 253 | extern int sysctl_tcp_thin_linear_timeouts; | 264 | extern int sysctl_tcp_thin_linear_timeouts; |
| 254 | extern int sysctl_tcp_thin_dupack; | 265 | extern int sysctl_tcp_thin_dupack; |
| 255 | extern int sysctl_tcp_early_retrans; | 266 | extern int sysctl_tcp_early_retrans; |
| 267 | extern int sysctl_tcp_limit_output_bytes; | ||
| 268 | extern int sysctl_tcp_challenge_ack_limit; | ||
| 256 | 269 | ||
| 257 | extern atomic_long_t tcp_memory_allocated; | 270 | extern atomic_long_t tcp_memory_allocated; |
| 258 | extern struct percpu_counter tcp_sockets_allocated; | 271 | extern struct percpu_counter tcp_sockets_allocated; |
| @@ -321,19 +334,24 @@ extern struct proto tcp_prot; | |||
| 321 | 334 | ||
| 322 | extern void tcp_init_mem(struct net *net); | 335 | extern void tcp_init_mem(struct net *net); |
| 323 | 336 | ||
| 337 | extern void tcp_tasklet_init(void); | ||
| 338 | |||
| 324 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 339 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
| 325 | 340 | ||
| 326 | extern void tcp_shutdown (struct sock *sk, int how); | 341 | extern void tcp_shutdown (struct sock *sk, int how); |
| 327 | 342 | ||
| 343 | extern void tcp_v4_early_demux(struct sk_buff *skb); | ||
| 328 | extern int tcp_v4_rcv(struct sk_buff *skb); | 344 | extern int tcp_v4_rcv(struct sk_buff *skb); |
| 329 | 345 | ||
| 330 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it); | 346 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); |
| 331 | extern void *tcp_v4_tw_get_peer(struct sock *sk); | ||
| 332 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 347 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
| 333 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 348 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 334 | size_t size); | 349 | size_t size); |
| 335 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, | 350 | extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, |
| 336 | size_t size, int flags); | 351 | size_t size, int flags); |
| 352 | extern void tcp_release_cb(struct sock *sk); | ||
| 353 | extern void tcp_write_timer_handler(struct sock *sk); | ||
| 354 | extern void tcp_delack_timer_handler(struct sock *sk); | ||
| 337 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 355 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
| 338 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 356 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
| 339 | const struct tcphdr *th, unsigned int len); | 357 | const struct tcphdr *th, unsigned int len); |
| @@ -388,6 +406,19 @@ extern void tcp_enter_frto(struct sock *sk); | |||
| 388 | extern void tcp_enter_loss(struct sock *sk, int how); | 406 | extern void tcp_enter_loss(struct sock *sk, int how); |
| 389 | extern void tcp_clear_retrans(struct tcp_sock *tp); | 407 | extern void tcp_clear_retrans(struct tcp_sock *tp); |
| 390 | extern void tcp_update_metrics(struct sock *sk); | 408 | extern void tcp_update_metrics(struct sock *sk); |
| 409 | extern void tcp_init_metrics(struct sock *sk); | ||
| 410 | extern void tcp_metrics_init(void); | ||
| 411 | extern bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst, bool paws_check); | ||
| 412 | extern bool tcp_remember_stamp(struct sock *sk); | ||
| 413 | extern bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw); | ||
| 414 | extern void tcp_fastopen_cache_get(struct sock *sk, u16 *mss, | ||
| 415 | struct tcp_fastopen_cookie *cookie, | ||
| 416 | int *syn_loss, unsigned long *last_syn_loss); | ||
| 417 | extern void tcp_fastopen_cache_set(struct sock *sk, u16 mss, | ||
| 418 | struct tcp_fastopen_cookie *cookie, | ||
| 419 | bool syn_lost); | ||
| 420 | extern void tcp_fetch_timewait_stamp(struct sock *sk, struct dst_entry *dst); | ||
| 421 | extern void tcp_disable_fack(struct tcp_sock *tp); | ||
| 391 | extern void tcp_close(struct sock *sk, long timeout); | 422 | extern void tcp_close(struct sock *sk, long timeout); |
| 392 | extern void tcp_init_sock(struct sock *sk); | 423 | extern void tcp_init_sock(struct sock *sk); |
| 393 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, | 424 | extern unsigned int tcp_poll(struct file * file, struct socket *sock, |
| @@ -406,7 +437,7 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 406 | size_t len, int nonblock, int flags, int *addr_len); | 437 | size_t len, int nonblock, int flags, int *addr_len); |
| 407 | extern void tcp_parse_options(const struct sk_buff *skb, | 438 | extern void tcp_parse_options(const struct sk_buff *skb, |
| 408 | struct tcp_options_received *opt_rx, const u8 **hvpp, | 439 | struct tcp_options_received *opt_rx, const u8 **hvpp, |
| 409 | int estab); | 440 | int estab, struct tcp_fastopen_cookie *foc); |
| 410 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); | 441 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); |
| 411 | 442 | ||
| 412 | /* | 443 | /* |
| @@ -556,6 +587,8 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | |||
| 556 | return (tp->srtt >> 3) + tp->rttvar; | 587 | return (tp->srtt >> 3) + tp->rttvar; |
| 557 | } | 588 | } |
| 558 | 589 | ||
| 590 | extern void tcp_set_rto(struct sock *sk); | ||
| 591 | |||
| 559 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 592 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
| 560 | { | 593 | { |
| 561 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 594 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
| @@ -1264,6 +1297,15 @@ extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff | |||
| 1264 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1297 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
| 1265 | const struct tcp_md5sig_key *key); | 1298 | const struct tcp_md5sig_key *key); |
| 1266 | 1299 | ||
| 1300 | struct tcp_fastopen_request { | ||
| 1301 | /* Fast Open cookie. Size 0 means a cookie request */ | ||
| 1302 | struct tcp_fastopen_cookie cookie; | ||
| 1303 | struct msghdr *data; /* data in MSG_FASTOPEN */ | ||
| 1304 | u16 copied; /* queued in tcp_connect() */ | ||
| 1305 | }; | ||
| 1306 | |||
| 1307 | void tcp_free_fastopen_req(struct tcp_sock *tp); | ||
| 1308 | |||
| 1267 | /* write queue abstraction */ | 1309 | /* write queue abstraction */ |
| 1268 | static inline void tcp_write_queue_purge(struct sock *sk) | 1310 | static inline void tcp_write_queue_purge(struct sock *sk) |
| 1269 | { | 1311 | { |
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h index 8d6689cb2c66..68f0ecad6c6e 100644 --- a/include/net/timewait_sock.h +++ b/include/net/timewait_sock.h | |||
| @@ -22,7 +22,6 @@ struct timewait_sock_ops { | |||
| 22 | int (*twsk_unique)(struct sock *sk, | 22 | int (*twsk_unique)(struct sock *sk, |
| 23 | struct sock *sktw, void *twp); | 23 | struct sock *sktw, void *twp); |
| 24 | void (*twsk_destructor)(struct sock *sk); | 24 | void (*twsk_destructor)(struct sock *sk); |
| 25 | void *(*twsk_getpeer)(struct sock *sk); | ||
| 26 | }; | 25 | }; |
| 27 | 26 | ||
| 28 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | 27 | static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) |
| @@ -41,11 +40,4 @@ static inline void twsk_destructor(struct sock *sk) | |||
| 41 | sk->sk_prot->twsk_prot->twsk_destructor(sk); | 40 | sk->sk_prot->twsk_prot->twsk_destructor(sk); |
| 42 | } | 41 | } |
| 43 | 42 | ||
| 44 | static inline void *twsk_getpeer(struct sock *sk) | ||
| 45 | { | ||
| 46 | if (sk->sk_prot->twsk_prot->twsk_getpeer) | ||
| 47 | return sk->sk_prot->twsk_prot->twsk_getpeer(sk); | ||
| 48 | return NULL; | ||
| 49 | } | ||
| 50 | |||
| 51 | #endif /* _TIMEWAIT_SOCK_H */ | 43 | #endif /* _TIMEWAIT_SOCK_H */ |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e0a55df5bde8..d9509eb29b80 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -1475,6 +1475,8 @@ extern int xfrm4_output(struct sk_buff *skb); | |||
| 1475 | extern int xfrm4_output_finish(struct sk_buff *skb); | 1475 | extern int xfrm4_output_finish(struct sk_buff *skb); |
| 1476 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); | 1476 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); |
| 1477 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); | 1477 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); |
| 1478 | extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler); | ||
| 1479 | extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler); | ||
| 1478 | extern int xfrm6_extract_header(struct sk_buff *skb); | 1480 | extern int xfrm6_extract_header(struct sk_buff *skb); |
| 1479 | extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); | 1481 | extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); |
| 1480 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); | 1482 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); |
| @@ -1682,13 +1684,11 @@ static inline int xfrm_mark_get(struct nlattr **attrs, struct xfrm_mark *m) | |||
| 1682 | 1684 | ||
| 1683 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) | 1685 | static inline int xfrm_mark_put(struct sk_buff *skb, const struct xfrm_mark *m) |
| 1684 | { | 1686 | { |
| 1685 | if ((m->m | m->v) && | 1687 | int ret = 0; |
| 1686 | nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m)) | ||
| 1687 | goto nla_put_failure; | ||
| 1688 | return 0; | ||
| 1689 | 1688 | ||
| 1690 | nla_put_failure: | 1689 | if (m->m | m->v) |
| 1691 | return -1; | 1690 | ret = nla_put(skb, XFRMA_MARK, sizeof(struct xfrm_mark), m); |
| 1691 | return ret; | ||
| 1692 | } | 1692 | } |
| 1693 | 1693 | ||
| 1694 | #endif /* _NET_XFRM_H */ | 1694 | #endif /* _NET_XFRM_H */ |
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h deleted file mode 100644 index e3005a674a24..000000000000 --- a/include/sound/cs46xx.h +++ /dev/null | |||
| @@ -1,1745 +0,0 @@ | |||
| 1 | #ifndef __SOUND_CS46XX_H | ||
| 2 | #define __SOUND_CS46XX_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, | ||
| 6 | * Cirrus Logic, Inc. | ||
| 7 | * Definitions for Cirrus Logic CS46xx chips | ||
| 8 | * | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (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 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 | #include "pcm.h" | ||
| 27 | #include "pcm-indirect.h" | ||
| 28 | #include "rawmidi.h" | ||
| 29 | #include "ac97_codec.h" | ||
| 30 | #include "cs46xx_dsp_spos.h" | ||
| 31 | |||
| 32 | /* | ||
| 33 | * Direct registers | ||
| 34 | */ | ||
| 35 | |||
| 36 | /* | ||
| 37 | * The following define the offsets of the registers accessed via base address | ||
| 38 | * register zero on the CS46xx part. | ||
| 39 | */ | ||
| 40 | #define BA0_HISR 0x00000000 | ||
| 41 | #define BA0_HSR0 0x00000004 | ||
| 42 | #define BA0_HICR 0x00000008 | ||
| 43 | #define BA0_DMSR 0x00000100 | ||
| 44 | #define BA0_HSAR 0x00000110 | ||
| 45 | #define BA0_HDAR 0x00000114 | ||
| 46 | #define BA0_HDMR 0x00000118 | ||
| 47 | #define BA0_HDCR 0x0000011C | ||
| 48 | #define BA0_PFMC 0x00000200 | ||
| 49 | #define BA0_PFCV1 0x00000204 | ||
| 50 | #define BA0_PFCV2 0x00000208 | ||
| 51 | #define BA0_PCICFG00 0x00000300 | ||
| 52 | #define BA0_PCICFG04 0x00000304 | ||
| 53 | #define BA0_PCICFG08 0x00000308 | ||
| 54 | #define BA0_PCICFG0C 0x0000030C | ||
| 55 | #define BA0_PCICFG10 0x00000310 | ||
| 56 | #define BA0_PCICFG14 0x00000314 | ||
| 57 | #define BA0_PCICFG18 0x00000318 | ||
| 58 | #define BA0_PCICFG1C 0x0000031C | ||
| 59 | #define BA0_PCICFG20 0x00000320 | ||
| 60 | #define BA0_PCICFG24 0x00000324 | ||
| 61 | #define BA0_PCICFG28 0x00000328 | ||
| 62 | #define BA0_PCICFG2C 0x0000032C | ||
| 63 | #define BA0_PCICFG30 0x00000330 | ||
| 64 | #define BA0_PCICFG34 0x00000334 | ||
| 65 | #define BA0_PCICFG38 0x00000338 | ||
| 66 | #define BA0_PCICFG3C 0x0000033C | ||
| 67 | #define BA0_CLKCR1 0x00000400 | ||
| 68 | #define BA0_CLKCR2 0x00000404 | ||
| 69 | #define BA0_PLLM 0x00000408 | ||
| 70 | #define BA0_PLLCC 0x0000040C | ||
| 71 | #define BA0_FRR 0x00000410 | ||
| 72 | #define BA0_CFL1 0x00000414 | ||
| 73 | #define BA0_CFL2 0x00000418 | ||
| 74 | #define BA0_SERMC1 0x00000420 | ||
| 75 | #define BA0_SERMC2 0x00000424 | ||
| 76 | #define BA0_SERC1 0x00000428 | ||
| 77 | #define BA0_SERC2 0x0000042C | ||
| 78 | #define BA0_SERC3 0x00000430 | ||
| 79 | #define BA0_SERC4 0x00000434 | ||
| 80 | #define BA0_SERC5 0x00000438 | ||
| 81 | #define BA0_SERBSP 0x0000043C | ||
| 82 | #define BA0_SERBST 0x00000440 | ||
| 83 | #define BA0_SERBCM 0x00000444 | ||
| 84 | #define BA0_SERBAD 0x00000448 | ||
| 85 | #define BA0_SERBCF 0x0000044C | ||
| 86 | #define BA0_SERBWP 0x00000450 | ||
| 87 | #define BA0_SERBRP 0x00000454 | ||
| 88 | #ifndef NO_CS4612 | ||
| 89 | #define BA0_ASER_FADDR 0x00000458 | ||
| 90 | #endif | ||
| 91 | #define BA0_ACCTL 0x00000460 | ||
| 92 | #define BA0_ACSTS 0x00000464 | ||
| 93 | #define BA0_ACOSV 0x00000468 | ||
| 94 | #define BA0_ACCAD 0x0000046C | ||
| 95 | #define BA0_ACCDA 0x00000470 | ||
| 96 | #define BA0_ACISV 0x00000474 | ||
| 97 | #define BA0_ACSAD 0x00000478 | ||
| 98 | #define BA0_ACSDA 0x0000047C | ||
| 99 | #define BA0_JSPT 0x00000480 | ||
| 100 | #define BA0_JSCTL 0x00000484 | ||
| 101 | #define BA0_JSC1 0x00000488 | ||
| 102 | #define BA0_JSC2 0x0000048C | ||
| 103 | #define BA0_MIDCR 0x00000490 | ||
| 104 | #define BA0_MIDSR 0x00000494 | ||
| 105 | #define BA0_MIDWP 0x00000498 | ||
| 106 | #define BA0_MIDRP 0x0000049C | ||
| 107 | #define BA0_JSIO 0x000004A0 | ||
| 108 | #ifndef NO_CS4612 | ||
| 109 | #define BA0_ASER_MASTER 0x000004A4 | ||
| 110 | #endif | ||
| 111 | #define BA0_CFGI 0x000004B0 | ||
| 112 | #define BA0_SSVID 0x000004B4 | ||
| 113 | #define BA0_GPIOR 0x000004B8 | ||
| 114 | #ifndef NO_CS4612 | ||
| 115 | #define BA0_EGPIODR 0x000004BC | ||
| 116 | #define BA0_EGPIOPTR 0x000004C0 | ||
| 117 | #define BA0_EGPIOTR 0x000004C4 | ||
| 118 | #define BA0_EGPIOWR 0x000004C8 | ||
| 119 | #define BA0_EGPIOSR 0x000004CC | ||
| 120 | #define BA0_SERC6 0x000004D0 | ||
| 121 | #define BA0_SERC7 0x000004D4 | ||
| 122 | #define BA0_SERACC 0x000004D8 | ||
| 123 | #define BA0_ACCTL2 0x000004E0 | ||
| 124 | #define BA0_ACSTS2 0x000004E4 | ||
| 125 | #define BA0_ACOSV2 0x000004E8 | ||
| 126 | #define BA0_ACCAD2 0x000004EC | ||
| 127 | #define BA0_ACCDA2 0x000004F0 | ||
| 128 | #define BA0_ACISV2 0x000004F4 | ||
| 129 | #define BA0_ACSAD2 0x000004F8 | ||
| 130 | #define BA0_ACSDA2 0x000004FC | ||
| 131 | #define BA0_IOTAC0 0x00000500 | ||
| 132 | #define BA0_IOTAC1 0x00000504 | ||
| 133 | #define BA0_IOTAC2 0x00000508 | ||
| 134 | #define BA0_IOTAC3 0x0000050C | ||
| 135 | #define BA0_IOTAC4 0x00000510 | ||
| 136 | #define BA0_IOTAC5 0x00000514 | ||
| 137 | #define BA0_IOTAC6 0x00000518 | ||
| 138 | #define BA0_IOTAC7 0x0000051C | ||
| 139 | #define BA0_IOTAC8 0x00000520 | ||
| 140 | #define BA0_IOTAC9 0x00000524 | ||
| 141 | #define BA0_IOTAC10 0x00000528 | ||
| 142 | #define BA0_IOTAC11 0x0000052C | ||
| 143 | #define BA0_IOTFR0 0x00000540 | ||
| 144 | #define BA0_IOTFR1 0x00000544 | ||
| 145 | #define BA0_IOTFR2 0x00000548 | ||
| 146 | #define BA0_IOTFR3 0x0000054C | ||
| 147 | #define BA0_IOTFR4 0x00000550 | ||
| 148 | #define BA0_IOTFR5 0x00000554 | ||
| 149 | #define BA0_IOTFR6 0x00000558 | ||
| 150 | #define BA0_IOTFR7 0x0000055C | ||
| 151 | #define BA0_IOTFIFO 0x00000580 | ||
| 152 | #define BA0_IOTRRD 0x00000584 | ||
| 153 | #define BA0_IOTFP 0x00000588 | ||
| 154 | #define BA0_IOTCR 0x0000058C | ||
| 155 | #define BA0_DPCID 0x00000590 | ||
| 156 | #define BA0_DPCIA 0x00000594 | ||
| 157 | #define BA0_DPCIC 0x00000598 | ||
| 158 | #define BA0_PCPCIR 0x00000600 | ||
| 159 | #define BA0_PCPCIG 0x00000604 | ||
| 160 | #define BA0_PCPCIEN 0x00000608 | ||
| 161 | #define BA0_EPCIPMC 0x00000610 | ||
| 162 | #endif | ||
| 163 | |||
| 164 | /* | ||
| 165 | * The following define the offsets of the registers and memories accessed via | ||
| 166 | * base address register one on the CS46xx part. | ||
| 167 | */ | ||
| 168 | #define BA1_SP_DMEM0 0x00000000 | ||
| 169 | #define BA1_SP_DMEM1 0x00010000 | ||
| 170 | #define BA1_SP_PMEM 0x00020000 | ||
| 171 | #define BA1_SP_REG 0x00030000 | ||
| 172 | #define BA1_SPCR 0x00030000 | ||
| 173 | #define BA1_DREG 0x00030004 | ||
| 174 | #define BA1_DSRWP 0x00030008 | ||
| 175 | #define BA1_TWPR 0x0003000C | ||
| 176 | #define BA1_SPWR 0x00030010 | ||
| 177 | #define BA1_SPIR 0x00030014 | ||
| 178 | #define BA1_FGR1 0x00030020 | ||
| 179 | #define BA1_SPCS 0x00030028 | ||
| 180 | #define BA1_SDSR 0x0003002C | ||
| 181 | #define BA1_FRMT 0x00030030 | ||
| 182 | #define BA1_FRCC 0x00030034 | ||
| 183 | #define BA1_FRSC 0x00030038 | ||
| 184 | #define BA1_OMNI_MEM 0x000E0000 | ||
| 185 | |||
| 186 | |||
| 187 | /* | ||
| 188 | * The following defines are for the flags in the host interrupt status | ||
| 189 | * register. | ||
| 190 | */ | ||
| 191 | #define HISR_VC_MASK 0x0000FFFF | ||
| 192 | #define HISR_VC0 0x00000001 | ||
| 193 | #define HISR_VC1 0x00000002 | ||
| 194 | #define HISR_VC2 0x00000004 | ||
| 195 | #define HISR_VC3 0x00000008 | ||
| 196 | #define HISR_VC4 0x00000010 | ||
| 197 | #define HISR_VC5 0x00000020 | ||
| 198 | #define HISR_VC6 0x00000040 | ||
| 199 | #define HISR_VC7 0x00000080 | ||
| 200 | #define HISR_VC8 0x00000100 | ||
| 201 | #define HISR_VC9 0x00000200 | ||
| 202 | #define HISR_VC10 0x00000400 | ||
| 203 | #define HISR_VC11 0x00000800 | ||
| 204 | #define HISR_VC12 0x00001000 | ||
| 205 | #define HISR_VC13 0x00002000 | ||
| 206 | #define HISR_VC14 0x00004000 | ||
| 207 | #define HISR_VC15 0x00008000 | ||
| 208 | #define HISR_INT0 0x00010000 | ||
| 209 | #define HISR_INT1 0x00020000 | ||
| 210 | #define HISR_DMAI 0x00040000 | ||
| 211 | #define HISR_FROVR 0x00080000 | ||
| 212 | #define HISR_MIDI 0x00100000 | ||
| 213 | #ifdef NO_CS4612 | ||
| 214 | #define HISR_RESERVED 0x0FE00000 | ||
| 215 | #else | ||
| 216 | #define HISR_SBINT 0x00200000 | ||
| 217 | #define HISR_RESERVED 0x0FC00000 | ||
| 218 | #endif | ||
| 219 | #define HISR_H0P 0x40000000 | ||
| 220 | #define HISR_INTENA 0x80000000 | ||
| 221 | |||
| 222 | /* | ||
| 223 | * The following defines are for the flags in the host signal register 0. | ||
| 224 | */ | ||
| 225 | #define HSR0_VC_MASK 0xFFFFFFFF | ||
| 226 | #define HSR0_VC16 0x00000001 | ||
| 227 | #define HSR0_VC17 0x00000002 | ||
| 228 | #define HSR0_VC18 0x00000004 | ||
| 229 | #define HSR0_VC19 0x00000008 | ||
| 230 | #define HSR0_VC20 0x00000010 | ||
| 231 | #define HSR0_VC21 0x00000020 | ||
| 232 | #define HSR0_VC22 0x00000040 | ||
| 233 | #define HSR0_VC23 0x00000080 | ||
| 234 | #define HSR0_VC24 0x00000100 | ||
| 235 | #define HSR0_VC25 0x00000200 | ||
| 236 | #define HSR0_VC26 0x00000400 | ||
| 237 | #define HSR0_VC27 0x00000800 | ||
| 238 | #define HSR0_VC28 0x00001000 | ||
| 239 | #define HSR0_VC29 0x00002000 | ||
| 240 | #define HSR0_VC30 0x00004000 | ||
| 241 | #define HSR0_VC31 0x00008000 | ||
| 242 | #define HSR0_VC32 0x00010000 | ||
| 243 | #define HSR0_VC33 0x00020000 | ||
| 244 | #define HSR0_VC34 0x00040000 | ||
| 245 | #define HSR0_VC35 0x00080000 | ||
| 246 | #define HSR0_VC36 0x00100000 | ||
| 247 | #define HSR0_VC37 0x00200000 | ||
| 248 | #define HSR0_VC38 0x00400000 | ||
| 249 | #define HSR0_VC39 0x00800000 | ||
| 250 | #define HSR0_VC40 0x01000000 | ||
| 251 | #define HSR0_VC41 0x02000000 | ||
| 252 | #define HSR0_VC42 0x04000000 | ||
| 253 | #define HSR0_VC43 0x08000000 | ||
| 254 | #define HSR0_VC44 0x10000000 | ||
| 255 | #define HSR0_VC45 0x20000000 | ||
| 256 | #define HSR0_VC46 0x40000000 | ||
| 257 | #define HSR0_VC47 0x80000000 | ||
| 258 | |||
| 259 | /* | ||
| 260 | * The following defines are for the flags in the host interrupt control | ||
| 261 | * register. | ||
| 262 | */ | ||
| 263 | #define HICR_IEV 0x00000001 | ||
| 264 | #define HICR_CHGM 0x00000002 | ||
| 265 | |||
| 266 | /* | ||
| 267 | * The following defines are for the flags in the DMA status register. | ||
| 268 | */ | ||
| 269 | #define DMSR_HP 0x00000001 | ||
| 270 | #define DMSR_HR 0x00000002 | ||
| 271 | #define DMSR_SP 0x00000004 | ||
| 272 | #define DMSR_SR 0x00000008 | ||
| 273 | |||
| 274 | /* | ||
| 275 | * The following defines are for the flags in the host DMA source address | ||
| 276 | * register. | ||
| 277 | */ | ||
| 278 | #define HSAR_HOST_ADDR_MASK 0xFFFFFFFF | ||
| 279 | #define HSAR_DSP_ADDR_MASK 0x0000FFFF | ||
| 280 | #define HSAR_MEMID_MASK 0x000F0000 | ||
| 281 | #define HSAR_MEMID_SP_DMEM0 0x00000000 | ||
| 282 | #define HSAR_MEMID_SP_DMEM1 0x00010000 | ||
| 283 | #define HSAR_MEMID_SP_PMEM 0x00020000 | ||
| 284 | #define HSAR_MEMID_SP_DEBUG 0x00030000 | ||
| 285 | #define HSAR_MEMID_OMNI_MEM 0x000E0000 | ||
| 286 | #define HSAR_END 0x40000000 | ||
| 287 | #define HSAR_ERR 0x80000000 | ||
| 288 | |||
| 289 | /* | ||
| 290 | * The following defines are for the flags in the host DMA destination address | ||
| 291 | * register. | ||
| 292 | */ | ||
| 293 | #define HDAR_HOST_ADDR_MASK 0xFFFFFFFF | ||
| 294 | #define HDAR_DSP_ADDR_MASK 0x0000FFFF | ||
| 295 | #define HDAR_MEMID_MASK 0x000F0000 | ||
| 296 | #define HDAR_MEMID_SP_DMEM0 0x00000000 | ||
| 297 | #define HDAR_MEMID_SP_DMEM1 0x00010000 | ||
| 298 | #define HDAR_MEMID_SP_PMEM 0x00020000 | ||
| 299 | #define HDAR_MEMID_SP_DEBUG 0x00030000 | ||
| 300 | #define HDAR_MEMID_OMNI_MEM 0x000E0000 | ||
| 301 | #define HDAR_END 0x40000000 | ||
| 302 | #define HDAR_ERR 0x80000000 | ||
| 303 | |||
| 304 | /* | ||
| 305 | * The following defines are for the flags in the host DMA control register. | ||
| 306 | */ | ||
| 307 | #define HDMR_AC_MASK 0x0000F000 | ||
| 308 | #define HDMR_AC_8_16 0x00001000 | ||
| 309 | #define HDMR_AC_M_S 0x00002000 | ||
| 310 | #define HDMR_AC_B_L 0x00004000 | ||
| 311 | #define HDMR_AC_S_U 0x00008000 | ||
| 312 | |||
| 313 | /* | ||
| 314 | * The following defines are for the flags in the host DMA control register. | ||
| 315 | */ | ||
| 316 | #define HDCR_COUNT_MASK 0x000003FF | ||
| 317 | #define HDCR_DONE 0x00004000 | ||
| 318 | #define HDCR_OPT 0x00008000 | ||
| 319 | #define HDCR_WBD 0x00400000 | ||
| 320 | #define HDCR_WBS 0x00800000 | ||
| 321 | #define HDCR_DMS_MASK 0x07000000 | ||
| 322 | #define HDCR_DMS_LINEAR 0x00000000 | ||
| 323 | #define HDCR_DMS_16_DWORDS 0x01000000 | ||
| 324 | #define HDCR_DMS_32_DWORDS 0x02000000 | ||
| 325 | #define HDCR_DMS_64_DWORDS 0x03000000 | ||
| 326 | #define HDCR_DMS_128_DWORDS 0x04000000 | ||
| 327 | #define HDCR_DMS_256_DWORDS 0x05000000 | ||
| 328 | #define HDCR_DMS_512_DWORDS 0x06000000 | ||
| 329 | #define HDCR_DMS_1024_DWORDS 0x07000000 | ||
| 330 | #define HDCR_DH 0x08000000 | ||
| 331 | #define HDCR_SMS_MASK 0x70000000 | ||
| 332 | #define HDCR_SMS_LINEAR 0x00000000 | ||
| 333 | #define HDCR_SMS_16_DWORDS 0x10000000 | ||
| 334 | #define HDCR_SMS_32_DWORDS 0x20000000 | ||
| 335 | #define HDCR_SMS_64_DWORDS 0x30000000 | ||
| 336 | #define HDCR_SMS_128_DWORDS 0x40000000 | ||
| 337 | #define HDCR_SMS_256_DWORDS 0x50000000 | ||
| 338 | #define HDCR_SMS_512_DWORDS 0x60000000 | ||
| 339 | #define HDCR_SMS_1024_DWORDS 0x70000000 | ||
| 340 | #define HDCR_SH 0x80000000 | ||
| 341 | #define HDCR_COUNT_SHIFT 0 | ||
| 342 | |||
| 343 | /* | ||
| 344 | * The following defines are for the flags in the performance monitor control | ||
| 345 | * register. | ||
| 346 | */ | ||
| 347 | #define PFMC_C1SS_MASK 0x0000001F | ||
| 348 | #define PFMC_C1EV 0x00000020 | ||
| 349 | #define PFMC_C1RS 0x00008000 | ||
| 350 | #define PFMC_C2SS_MASK 0x001F0000 | ||
| 351 | #define PFMC_C2EV 0x00200000 | ||
| 352 | #define PFMC_C2RS 0x80000000 | ||
| 353 | #define PFMC_C1SS_SHIFT 0 | ||
| 354 | #define PFMC_C2SS_SHIFT 16 | ||
| 355 | #define PFMC_BUS_GRANT 0 | ||
| 356 | #define PFMC_GRANT_AFTER_REQ 1 | ||
| 357 | #define PFMC_TRANSACTION 2 | ||
| 358 | #define PFMC_DWORD_TRANSFER 3 | ||
| 359 | #define PFMC_SLAVE_READ 4 | ||
| 360 | #define PFMC_SLAVE_WRITE 5 | ||
| 361 | #define PFMC_PREEMPTION 6 | ||
| 362 | #define PFMC_DISCONNECT_RETRY 7 | ||
| 363 | #define PFMC_INTERRUPT 8 | ||
| 364 | #define PFMC_BUS_OWNERSHIP 9 | ||
| 365 | #define PFMC_TRANSACTION_LAG 10 | ||
| 366 | #define PFMC_PCI_CLOCK 11 | ||
| 367 | #define PFMC_SERIAL_CLOCK 12 | ||
| 368 | #define PFMC_SP_CLOCK 13 | ||
| 369 | |||
| 370 | /* | ||
| 371 | * The following defines are for the flags in the performance counter value 1 | ||
| 372 | * register. | ||
| 373 | */ | ||
| 374 | #define PFCV1_PC1V_MASK 0xFFFFFFFF | ||
| 375 | #define PFCV1_PC1V_SHIFT 0 | ||
| 376 | |||
| 377 | /* | ||
| 378 | * The following defines are for the flags in the performance counter value 2 | ||
| 379 | * register. | ||
| 380 | */ | ||
| 381 | #define PFCV2_PC2V_MASK 0xFFFFFFFF | ||
| 382 | #define PFCV2_PC2V_SHIFT 0 | ||
| 383 | |||
| 384 | /* | ||
| 385 | * The following defines are for the flags in the clock control register 1. | ||
| 386 | */ | ||
| 387 | #define CLKCR1_OSCS 0x00000001 | ||
| 388 | #define CLKCR1_OSCP 0x00000002 | ||
| 389 | #define CLKCR1_PLLSS_MASK 0x0000000C | ||
| 390 | #define CLKCR1_PLLSS_SERIAL 0x00000000 | ||
| 391 | #define CLKCR1_PLLSS_CRYSTAL 0x00000004 | ||
| 392 | #define CLKCR1_PLLSS_PCI 0x00000008 | ||
| 393 | #define CLKCR1_PLLSS_RESERVED 0x0000000C | ||
| 394 | #define CLKCR1_PLLP 0x00000010 | ||
| 395 | #define CLKCR1_SWCE 0x00000020 | ||
| 396 | #define CLKCR1_PLLOS 0x00000040 | ||
| 397 | |||
| 398 | /* | ||
| 399 | * The following defines are for the flags in the clock control register 2. | ||
| 400 | */ | ||
| 401 | #define CLKCR2_PDIVS_MASK 0x0000000F | ||
| 402 | #define CLKCR2_PDIVS_1 0x00000001 | ||
| 403 | #define CLKCR2_PDIVS_2 0x00000002 | ||
| 404 | #define CLKCR2_PDIVS_4 0x00000004 | ||
| 405 | #define CLKCR2_PDIVS_7 0x00000007 | ||
| 406 | #define CLKCR2_PDIVS_8 0x00000008 | ||
| 407 | #define CLKCR2_PDIVS_16 0x00000000 | ||
| 408 | |||
| 409 | /* | ||
| 410 | * The following defines are for the flags in the PLL multiplier register. | ||
| 411 | */ | ||
| 412 | #define PLLM_MASK 0x000000FF | ||
| 413 | #define PLLM_SHIFT 0 | ||
| 414 | |||
| 415 | /* | ||
| 416 | * The following defines are for the flags in the PLL capacitor coefficient | ||
| 417 | * register. | ||
| 418 | */ | ||
| 419 | #define PLLCC_CDR_MASK 0x00000007 | ||
| 420 | #ifndef NO_CS4610 | ||
| 421 | #define PLLCC_CDR_240_350_MHZ 0x00000000 | ||
| 422 | #define PLLCC_CDR_184_265_MHZ 0x00000001 | ||
| 423 | #define PLLCC_CDR_144_205_MHZ 0x00000002 | ||
| 424 | #define PLLCC_CDR_111_160_MHZ 0x00000003 | ||
| 425 | #define PLLCC_CDR_87_123_MHZ 0x00000004 | ||
| 426 | #define PLLCC_CDR_67_96_MHZ 0x00000005 | ||
| 427 | #define PLLCC_CDR_52_74_MHZ 0x00000006 | ||
| 428 | #define PLLCC_CDR_45_58_MHZ 0x00000007 | ||
| 429 | #endif | ||
| 430 | #ifndef NO_CS4612 | ||
| 431 | #define PLLCC_CDR_271_398_MHZ 0x00000000 | ||
| 432 | #define PLLCC_CDR_227_330_MHZ 0x00000001 | ||
| 433 | #define PLLCC_CDR_167_239_MHZ 0x00000002 | ||
| 434 | #define PLLCC_CDR_150_215_MHZ 0x00000003 | ||
| 435 | #define PLLCC_CDR_107_154_MHZ 0x00000004 | ||
| 436 | #define PLLCC_CDR_98_140_MHZ 0x00000005 | ||
| 437 | #define PLLCC_CDR_73_104_MHZ 0x00000006 | ||
| 438 | #define PLLCC_CDR_63_90_MHZ 0x00000007 | ||
| 439 | #endif | ||
| 440 | #define PLLCC_LPF_MASK 0x000000F8 | ||
| 441 | #ifndef NO_CS4610 | ||
| 442 | #define PLLCC_LPF_23850_60000_KHZ 0x00000000 | ||
| 443 | #define PLLCC_LPF_7960_26290_KHZ 0x00000008 | ||
| 444 | #define PLLCC_LPF_4160_10980_KHZ 0x00000018 | ||
| 445 | #define PLLCC_LPF_1740_4580_KHZ 0x00000038 | ||
| 446 | #define PLLCC_LPF_724_1910_KHZ 0x00000078 | ||
| 447 | #define PLLCC_LPF_317_798_KHZ 0x000000F8 | ||
| 448 | #endif | ||
| 449 | #ifndef NO_CS4612 | ||
| 450 | #define PLLCC_LPF_25580_64530_KHZ 0x00000000 | ||
| 451 | #define PLLCC_LPF_14360_37270_KHZ 0x00000008 | ||
| 452 | #define PLLCC_LPF_6100_16020_KHZ 0x00000018 | ||
| 453 | #define PLLCC_LPF_2540_6690_KHZ 0x00000038 | ||
| 454 | #define PLLCC_LPF_1050_2780_KHZ 0x00000078 | ||
| 455 | #define PLLCC_LPF_450_1160_KHZ 0x000000F8 | ||
| 456 | #endif | ||
| 457 | |||
| 458 | /* | ||
| 459 | * The following defines are for the flags in the feature reporting register. | ||
| 460 | */ | ||
| 461 | #define FRR_FAB_MASK 0x00000003 | ||
| 462 | #define FRR_MASK_MASK 0x0000001C | ||
| 463 | #ifdef NO_CS4612 | ||
| 464 | #define FRR_CFOP_MASK 0x000000E0 | ||
| 465 | #else | ||
| 466 | #define FRR_CFOP_MASK 0x00000FE0 | ||
| 467 | #endif | ||
| 468 | #define FRR_CFOP_NOT_DVD 0x00000020 | ||
| 469 | #define FRR_CFOP_A3D 0x00000040 | ||
| 470 | #define FRR_CFOP_128_PIN 0x00000080 | ||
| 471 | #ifndef NO_CS4612 | ||
| 472 | #define FRR_CFOP_CS4280 0x00000800 | ||
| 473 | #endif | ||
| 474 | #define FRR_FAB_SHIFT 0 | ||
| 475 | #define FRR_MASK_SHIFT 2 | ||
| 476 | #define FRR_CFOP_SHIFT 5 | ||
| 477 | |||
| 478 | /* | ||
| 479 | * The following defines are for the flags in the configuration load 1 | ||
| 480 | * register. | ||
| 481 | */ | ||
| 482 | #define CFL1_CLOCK_SOURCE_MASK 0x00000003 | ||
| 483 | #define CFL1_CLOCK_SOURCE_CS423X 0x00000000 | ||
| 484 | #define CFL1_CLOCK_SOURCE_AC97 0x00000001 | ||
| 485 | #define CFL1_CLOCK_SOURCE_CRYSTAL 0x00000002 | ||
| 486 | #define CFL1_CLOCK_SOURCE_DUAL_AC97 0x00000003 | ||
| 487 | #define CFL1_VALID_DATA_MASK 0x000000FF | ||
| 488 | |||
| 489 | /* | ||
| 490 | * The following defines are for the flags in the configuration load 2 | ||
| 491 | * register. | ||
| 492 | */ | ||
| 493 | #define CFL2_VALID_DATA_MASK 0x000000FF | ||
| 494 | |||
| 495 | /* | ||
| 496 | * The following defines are for the flags in the serial port master control | ||
| 497 | * register 1. | ||
| 498 | */ | ||
| 499 | #define SERMC1_MSPE 0x00000001 | ||
| 500 | #define SERMC1_PTC_MASK 0x0000000E | ||
| 501 | #define SERMC1_PTC_CS423X 0x00000000 | ||
| 502 | #define SERMC1_PTC_AC97 0x00000002 | ||
| 503 | #define SERMC1_PTC_DAC 0x00000004 | ||
| 504 | #define SERMC1_PLB 0x00000010 | ||
| 505 | #define SERMC1_XLB 0x00000020 | ||
| 506 | |||
| 507 | /* | ||
| 508 | * The following defines are for the flags in the serial port master control | ||
| 509 | * register 2. | ||
| 510 | */ | ||
| 511 | #define SERMC2_LROE 0x00000001 | ||
| 512 | #define SERMC2_MCOE 0x00000002 | ||
| 513 | #define SERMC2_MCDIV 0x00000004 | ||
| 514 | |||
| 515 | /* | ||
| 516 | * The following defines are for the flags in the serial port 1 configuration | ||
| 517 | * register. | ||
| 518 | */ | ||
| 519 | #define SERC1_SO1EN 0x00000001 | ||
| 520 | #define SERC1_SO1F_MASK 0x0000000E | ||
| 521 | #define SERC1_SO1F_CS423X 0x00000000 | ||
| 522 | #define SERC1_SO1F_AC97 0x00000002 | ||
| 523 | #define SERC1_SO1F_DAC 0x00000004 | ||
| 524 | #define SERC1_SO1F_SPDIF 0x00000006 | ||
| 525 | |||
| 526 | /* | ||
| 527 | * The following defines are for the flags in the serial port 2 configuration | ||
| 528 | * register. | ||
| 529 | */ | ||
| 530 | #define SERC2_SI1EN 0x00000001 | ||
| 531 | #define SERC2_SI1F_MASK 0x0000000E | ||
| 532 | #define SERC2_SI1F_CS423X 0x00000000 | ||
| 533 | #define SERC2_SI1F_AC97 0x00000002 | ||
| 534 | #define SERC2_SI1F_ADC 0x00000004 | ||
| 535 | #define SERC2_SI1F_SPDIF 0x00000006 | ||
| 536 | |||
| 537 | /* | ||
| 538 | * The following defines are for the flags in the serial port 3 configuration | ||
| 539 | * register. | ||
| 540 | */ | ||
| 541 | #define SERC3_SO2EN 0x00000001 | ||
| 542 | #define SERC3_SO2F_MASK 0x00000006 | ||
| 543 | #define SERC3_SO2F_DAC 0x00000000 | ||
| 544 | #define SERC3_SO2F_SPDIF 0x00000002 | ||
| 545 | |||
| 546 | /* | ||
| 547 | * The following defines are for the flags in the serial port 4 configuration | ||
| 548 | * register. | ||
| 549 | */ | ||
| 550 | #define SERC4_SO3EN 0x00000001 | ||
| 551 | #define SERC4_SO3F_MASK 0x00000006 | ||
| 552 | #define SERC4_SO3F_DAC 0x00000000 | ||
| 553 | #define SERC4_SO3F_SPDIF 0x00000002 | ||
| 554 | |||
| 555 | /* | ||
| 556 | * The following defines are for the flags in the serial port 5 configuration | ||
| 557 | * register. | ||
| 558 | */ | ||
| 559 | #define SERC5_SI2EN 0x00000001 | ||
| 560 | #define SERC5_SI2F_MASK 0x00000006 | ||
| 561 | #define SERC5_SI2F_ADC 0x00000000 | ||
| 562 | #define SERC5_SI2F_SPDIF 0x00000002 | ||
| 563 | |||
| 564 | /* | ||
| 565 | * The following defines are for the flags in the serial port backdoor sample | ||
| 566 | * pointer register. | ||
| 567 | */ | ||
| 568 | #define SERBSP_FSP_MASK 0x0000000F | ||
| 569 | #define SERBSP_FSP_SHIFT 0 | ||
| 570 | |||
| 571 | /* | ||
| 572 | * The following defines are for the flags in the serial port backdoor status | ||
| 573 | * register. | ||
| 574 | */ | ||
| 575 | #define SERBST_RRDY 0x00000001 | ||
| 576 | #define SERBST_WBSY 0x00000002 | ||
| 577 | |||
| 578 | /* | ||
| 579 | * The following defines are for the flags in the serial port backdoor command | ||
| 580 | * register. | ||
| 581 | */ | ||
| 582 | #define SERBCM_RDC 0x00000001 | ||
| 583 | #define SERBCM_WRC 0x00000002 | ||
| 584 | |||
| 585 | /* | ||
| 586 | * The following defines are for the flags in the serial port backdoor address | ||
| 587 | * register. | ||
| 588 | */ | ||
| 589 | #ifdef NO_CS4612 | ||
| 590 | #define SERBAD_FAD_MASK 0x000000FF | ||
| 591 | #else | ||
| 592 | #define SERBAD_FAD_MASK 0x000001FF | ||
| 593 | #endif | ||
| 594 | #define SERBAD_FAD_SHIFT 0 | ||
| 595 | |||
| 596 | /* | ||
| 597 | * The following defines are for the flags in the serial port backdoor | ||
| 598 | * configuration register. | ||
| 599 | */ | ||
| 600 | #define SERBCF_HBP 0x00000001 | ||
| 601 | |||
| 602 | /* | ||
| 603 | * The following defines are for the flags in the serial port backdoor write | ||
| 604 | * port register. | ||
| 605 | */ | ||
| 606 | #define SERBWP_FWD_MASK 0x000FFFFF | ||
| 607 | #define SERBWP_FWD_SHIFT 0 | ||
| 608 | |||
| 609 | /* | ||
| 610 | * The following defines are for the flags in the serial port backdoor read | ||
| 611 | * port register. | ||
| 612 | */ | ||
| 613 | #define SERBRP_FRD_MASK 0x000FFFFF | ||
| 614 | #define SERBRP_FRD_SHIFT 0 | ||
| 615 | |||
| 616 | /* | ||
| 617 | * The following defines are for the flags in the async FIFO address register. | ||
| 618 | */ | ||
| 619 | #ifndef NO_CS4612 | ||
| 620 | #define ASER_FADDR_A1_MASK 0x000001FF | ||
| 621 | #define ASER_FADDR_EN1 0x00008000 | ||
| 622 | #define ASER_FADDR_A2_MASK 0x01FF0000 | ||
| 623 | #define ASER_FADDR_EN2 0x80000000 | ||
| 624 | #define ASER_FADDR_A1_SHIFT 0 | ||
| 625 | #define ASER_FADDR_A2_SHIFT 16 | ||
| 626 | #endif | ||
| 627 | |||
| 628 | /* | ||
| 629 | * The following defines are for the flags in the AC97 control register. | ||
| 630 | */ | ||
| 631 | #define ACCTL_RSTN 0x00000001 | ||
| 632 | #define ACCTL_ESYN 0x00000002 | ||
| 633 | #define ACCTL_VFRM 0x00000004 | ||
| 634 | #define ACCTL_DCV 0x00000008 | ||
| 635 | #define ACCTL_CRW 0x00000010 | ||
| 636 | #define ACCTL_ASYN 0x00000020 | ||
| 637 | #ifndef NO_CS4612 | ||
| 638 | #define ACCTL_TC 0x00000040 | ||
| 639 | #endif | ||
| 640 | |||
| 641 | /* | ||
| 642 | * The following defines are for the flags in the AC97 status register. | ||
| 643 | */ | ||
| 644 | #define ACSTS_CRDY 0x00000001 | ||
| 645 | #define ACSTS_VSTS 0x00000002 | ||
| 646 | #ifndef NO_CS4612 | ||
| 647 | #define ACSTS_WKUP 0x00000004 | ||
| 648 | #endif | ||
| 649 | |||
| 650 | /* | ||
| 651 | * The following defines are for the flags in the AC97 output slot valid | ||
| 652 | * register. | ||
| 653 | */ | ||
| 654 | #define ACOSV_SLV3 0x00000001 | ||
| 655 | #define ACOSV_SLV4 0x00000002 | ||
| 656 | #define ACOSV_SLV5 0x00000004 | ||
| 657 | #define ACOSV_SLV6 0x00000008 | ||
| 658 | #define ACOSV_SLV7 0x00000010 | ||
| 659 | #define ACOSV_SLV8 0x00000020 | ||
| 660 | #define ACOSV_SLV9 0x00000040 | ||
| 661 | #define ACOSV_SLV10 0x00000080 | ||
| 662 | #define ACOSV_SLV11 0x00000100 | ||
| 663 | #define ACOSV_SLV12 0x00000200 | ||
| 664 | |||
| 665 | /* | ||
| 666 | * The following defines are for the flags in the AC97 command address | ||
| 667 | * register. | ||
| 668 | */ | ||
| 669 | #define ACCAD_CI_MASK 0x0000007F | ||
| 670 | #define ACCAD_CI_SHIFT 0 | ||
| 671 | |||
| 672 | /* | ||
| 673 | * The following defines are for the flags in the AC97 command data register. | ||
| 674 | */ | ||
| 675 | #define ACCDA_CD_MASK 0x0000FFFF | ||
| 676 | #define ACCDA_CD_SHIFT 0 | ||
| 677 | |||
| 678 | /* | ||
| 679 | * The following defines are for the flags in the AC97 input slot valid | ||
| 680 | * register. | ||
| 681 | */ | ||
| 682 | #define ACISV_ISV3 0x00000001 | ||
| 683 | #define ACISV_ISV4 0x00000002 | ||
| 684 | #define ACISV_ISV5 0x00000004 | ||
| 685 | #define ACISV_ISV6 0x00000008 | ||
| 686 | #define ACISV_ISV7 0x00000010 | ||
| 687 | #define ACISV_ISV8 0x00000020 | ||
| 688 | #define ACISV_ISV9 0x00000040 | ||
| 689 | #define ACISV_ISV10 0x00000080 | ||
| 690 | #define ACISV_ISV11 0x00000100 | ||
| 691 | #define ACISV_ISV12 0x00000200 | ||
| 692 | |||
| 693 | /* | ||
| 694 | * The following defines are for the flags in the AC97 status address | ||
| 695 | * register. | ||
| 696 | */ | ||
| 697 | #define ACSAD_SI_MASK 0x0000007F | ||
| 698 | #define ACSAD_SI_SHIFT 0 | ||
| 699 | |||
| 700 | /* | ||
| 701 | * The following defines are for the flags in the AC97 status data register. | ||
| 702 | */ | ||
| 703 | #define ACSDA_SD_MASK 0x0000FFFF | ||
| 704 | #define ACSDA_SD_SHIFT 0 | ||
| 705 | |||
| 706 | /* | ||
| 707 | * The following defines are for the flags in the joystick poll/trigger | ||
| 708 | * register. | ||
| 709 | */ | ||
| 710 | #define JSPT_CAX 0x00000001 | ||
| 711 | #define JSPT_CAY 0x00000002 | ||
| 712 | #define JSPT_CBX 0x00000004 | ||
| 713 | #define JSPT_CBY 0x00000008 | ||
| 714 | #define JSPT_BA1 0x00000010 | ||
| 715 | #define JSPT_BA2 0x00000020 | ||
| 716 | #define JSPT_BB1 0x00000040 | ||
| 717 | #define JSPT_BB2 0x00000080 | ||
| 718 | |||
| 719 | /* | ||
| 720 | * The following defines are for the flags in the joystick control register. | ||
| 721 | */ | ||
| 722 | #define JSCTL_SP_MASK 0x00000003 | ||
| 723 | #define JSCTL_SP_SLOW 0x00000000 | ||
| 724 | #define JSCTL_SP_MEDIUM_SLOW 0x00000001 | ||
| 725 | #define JSCTL_SP_MEDIUM_FAST 0x00000002 | ||
| 726 | #define JSCTL_SP_FAST 0x00000003 | ||
| 727 | #define JSCTL_ARE 0x00000004 | ||
| 728 | |||
| 729 | /* | ||
| 730 | * The following defines are for the flags in the joystick coordinate pair 1 | ||
| 731 | * readback register. | ||
| 732 | */ | ||
| 733 | #define JSC1_Y1V_MASK 0x0000FFFF | ||
| 734 | #define JSC1_X1V_MASK 0xFFFF0000 | ||
| 735 | #define JSC1_Y1V_SHIFT 0 | ||
| 736 | #define JSC1_X1V_SHIFT 16 | ||
| 737 | |||
| 738 | /* | ||
| 739 | * The following defines are for the flags in the joystick coordinate pair 2 | ||
| 740 | * readback register. | ||
| 741 | */ | ||
| 742 | #define JSC2_Y2V_MASK 0x0000FFFF | ||
| 743 | #define JSC2_X2V_MASK 0xFFFF0000 | ||
| 744 | #define JSC2_Y2V_SHIFT 0 | ||
| 745 | #define JSC2_X2V_SHIFT 16 | ||
| 746 | |||
| 747 | /* | ||
| 748 | * The following defines are for the flags in the MIDI control register. | ||
| 749 | */ | ||
| 750 | #define MIDCR_TXE 0x00000001 /* Enable transmitting. */ | ||
| 751 | #define MIDCR_RXE 0x00000002 /* Enable receiving. */ | ||
| 752 | #define MIDCR_RIE 0x00000004 /* Interrupt upon tx ready. */ | ||
| 753 | #define MIDCR_TIE 0x00000008 /* Interrupt upon rx ready. */ | ||
| 754 | #define MIDCR_MLB 0x00000010 /* Enable midi loopback. */ | ||
| 755 | #define MIDCR_MRST 0x00000020 /* Reset interface. */ | ||
| 756 | |||
| 757 | /* | ||
| 758 | * The following defines are for the flags in the MIDI status register. | ||
| 759 | */ | ||
| 760 | #define MIDSR_TBF 0x00000001 /* Tx FIFO is full. */ | ||
| 761 | #define MIDSR_RBE 0x00000002 /* Rx FIFO is empty. */ | ||
| 762 | |||
| 763 | /* | ||
| 764 | * The following defines are for the flags in the MIDI write port register. | ||
| 765 | */ | ||
| 766 | #define MIDWP_MWD_MASK 0x000000FF | ||
| 767 | #define MIDWP_MWD_SHIFT 0 | ||
| 768 | |||
| 769 | /* | ||
| 770 | * The following defines are for the flags in the MIDI read port register. | ||
| 771 | */ | ||
| 772 | #define MIDRP_MRD_MASK 0x000000FF | ||
| 773 | #define MIDRP_MRD_SHIFT 0 | ||
| 774 | |||
| 775 | /* | ||
| 776 | * The following defines are for the flags in the joystick GPIO register. | ||
| 777 | */ | ||
| 778 | #define JSIO_DAX 0x00000001 | ||
| 779 | #define JSIO_DAY 0x00000002 | ||
| 780 | #define JSIO_DBX 0x00000004 | ||
| 781 | #define JSIO_DBY 0x00000008 | ||
| 782 | #define JSIO_AXOE 0x00000010 | ||
| 783 | #define JSIO_AYOE 0x00000020 | ||
| 784 | #define JSIO_BXOE 0x00000040 | ||
| 785 | #define JSIO_BYOE 0x00000080 | ||
| 786 | |||
| 787 | /* | ||
| 788 | * The following defines are for the flags in the master async/sync serial | ||
| 789 | * port enable register. | ||
| 790 | */ | ||
| 791 | #ifndef NO_CS4612 | ||
| 792 | #define ASER_MASTER_ME 0x00000001 | ||
| 793 | #endif | ||
| 794 | |||
| 795 | /* | ||
| 796 | * The following defines are for the flags in the configuration interface | ||
| 797 | * register. | ||
| 798 | */ | ||
| 799 | #define CFGI_CLK 0x00000001 | ||
| 800 | #define CFGI_DOUT 0x00000002 | ||
| 801 | #define CFGI_DIN_EEN 0x00000004 | ||
| 802 | #define CFGI_EELD 0x00000008 | ||
| 803 | |||
| 804 | /* | ||
| 805 | * The following defines are for the flags in the subsystem ID and vendor ID | ||
| 806 | * register. | ||
| 807 | */ | ||
| 808 | #define SSVID_VID_MASK 0x0000FFFF | ||
| 809 | #define SSVID_SID_MASK 0xFFFF0000 | ||
| 810 | #define SSVID_VID_SHIFT 0 | ||
| 811 | #define SSVID_SID_SHIFT 16 | ||
| 812 | |||
| 813 | /* | ||
| 814 | * The following defines are for the flags in the GPIO pin interface register. | ||
| 815 | */ | ||
| 816 | #define GPIOR_VOLDN 0x00000001 | ||
| 817 | #define GPIOR_VOLUP 0x00000002 | ||
| 818 | #define GPIOR_SI2D 0x00000004 | ||
| 819 | #define GPIOR_SI2OE 0x00000008 | ||
| 820 | |||
| 821 | /* | ||
| 822 | * The following defines are for the flags in the extended GPIO pin direction | ||
| 823 | * register. | ||
| 824 | */ | ||
| 825 | #ifndef NO_CS4612 | ||
| 826 | #define EGPIODR_GPOE0 0x00000001 | ||
| 827 | #define EGPIODR_GPOE1 0x00000002 | ||
| 828 | #define EGPIODR_GPOE2 0x00000004 | ||
| 829 | #define EGPIODR_GPOE3 0x00000008 | ||
| 830 | #define EGPIODR_GPOE4 0x00000010 | ||
| 831 | #define EGPIODR_GPOE5 0x00000020 | ||
| 832 | #define EGPIODR_GPOE6 0x00000040 | ||
| 833 | #define EGPIODR_GPOE7 0x00000080 | ||
| 834 | #define EGPIODR_GPOE8 0x00000100 | ||
| 835 | #endif | ||
| 836 | |||
| 837 | /* | ||
| 838 | * The following defines are for the flags in the extended GPIO pin polarity/ | ||
| 839 | * type register. | ||
| 840 | */ | ||
| 841 | #ifndef NO_CS4612 | ||
| 842 | #define EGPIOPTR_GPPT0 0x00000001 | ||
| 843 | #define EGPIOPTR_GPPT1 0x00000002 | ||
| 844 | #define EGPIOPTR_GPPT2 0x00000004 | ||
| 845 | #define EGPIOPTR_GPPT3 0x00000008 | ||
| 846 | #define EGPIOPTR_GPPT4 0x00000010 | ||
| 847 | #define EGPIOPTR_GPPT5 0x00000020 | ||
| 848 | #define EGPIOPTR_GPPT6 0x00000040 | ||
| 849 | #define EGPIOPTR_GPPT7 0x00000080 | ||
| 850 | #define EGPIOPTR_GPPT8 0x00000100 | ||
| 851 | #endif | ||
| 852 | |||
| 853 | /* | ||
| 854 | * The following defines are for the flags in the extended GPIO pin sticky | ||
| 855 | * register. | ||
| 856 | */ | ||
| 857 | #ifndef NO_CS4612 | ||
| 858 | #define EGPIOTR_GPS0 0x00000001 | ||
| 859 | #define EGPIOTR_GPS1 0x00000002 | ||
| 860 | #define EGPIOTR_GPS2 0x00000004 | ||
| 861 | #define EGPIOTR_GPS3 0x00000008 | ||
| 862 | #define EGPIOTR_GPS4 0x00000010 | ||
| 863 | #define EGPIOTR_GPS5 0x00000020 | ||
| 864 | #define EGPIOTR_GPS6 0x00000040 | ||
| 865 | #define EGPIOTR_GPS7 0x00000080 | ||
| 866 | #define EGPIOTR_GPS8 0x00000100 | ||
| 867 | #endif | ||
| 868 | |||
| 869 | /* | ||
| 870 | * The following defines are for the flags in the extended GPIO ping wakeup | ||
| 871 | * register. | ||
| 872 | */ | ||
| 873 | #ifndef NO_CS4612 | ||
| 874 | #define EGPIOWR_GPW0 0x00000001 | ||
| 875 | #define EGPIOWR_GPW1 0x00000002 | ||
| 876 | #define EGPIOWR_GPW2 0x00000004 | ||
| 877 | #define EGPIOWR_GPW3 0x00000008 | ||
| 878 | #define EGPIOWR_GPW4 0x00000010 | ||
| 879 | #define EGPIOWR_GPW5 0x00000020 | ||
| 880 | #define EGPIOWR_GPW6 0x00000040 | ||
| 881 | #define EGPIOWR_GPW7 0x00000080 | ||
| 882 | #define EGPIOWR_GPW8 0x00000100 | ||
| 883 | #endif | ||
| 884 | |||
| 885 | /* | ||
| 886 | * The following defines are for the flags in the extended GPIO pin status | ||
| 887 | * register. | ||
| 888 | */ | ||
| 889 | #ifndef NO_CS4612 | ||
| 890 | #define EGPIOSR_GPS0 0x00000001 | ||
| 891 | #define EGPIOSR_GPS1 0x00000002 | ||
| 892 | #define EGPIOSR_GPS2 0x00000004 | ||
| 893 | #define EGPIOSR_GPS3 0x00000008 | ||
| 894 | #define EGPIOSR_GPS4 0x00000010 | ||
| 895 | #define EGPIOSR_GPS5 0x00000020 | ||
| 896 | #define EGPIOSR_GPS6 0x00000040 | ||
| 897 | #define EGPIOSR_GPS7 0x00000080 | ||
| 898 | #define EGPIOSR_GPS8 0x00000100 | ||
| 899 | #endif | ||
| 900 | |||
| 901 | /* | ||
| 902 | * The following defines are for the flags in the serial port 6 configuration | ||
| 903 | * register. | ||
| 904 | */ | ||
| 905 | #ifndef NO_CS4612 | ||
| 906 | #define SERC6_ASDO2EN 0x00000001 | ||
| 907 | #endif | ||
| 908 | |||
| 909 | /* | ||
| 910 | * The following defines are for the flags in the serial port 7 configuration | ||
| 911 | * register. | ||
| 912 | */ | ||
| 913 | #ifndef NO_CS4612 | ||
| 914 | #define SERC7_ASDI2EN 0x00000001 | ||
| 915 | #define SERC7_POSILB 0x00000002 | ||
| 916 | #define SERC7_SIPOLB 0x00000004 | ||
| 917 | #define SERC7_SOSILB 0x00000008 | ||
| 918 | #define SERC7_SISOLB 0x00000010 | ||
| 919 | #endif | ||
| 920 | |||
| 921 | /* | ||
| 922 | * The following defines are for the flags in the serial port AC link | ||
| 923 | * configuration register. | ||
| 924 | */ | ||
| 925 | #ifndef NO_CS4612 | ||
| 926 | #define SERACC_CHIP_TYPE_MASK 0x00000001 | ||
| 927 | #define SERACC_CHIP_TYPE_1_03 0x00000000 | ||
| 928 | #define SERACC_CHIP_TYPE_2_0 0x00000001 | ||
| 929 | #define SERACC_TWO_CODECS 0x00000002 | ||
| 930 | #define SERACC_MDM 0x00000004 | ||
| 931 | #define SERACC_HSP 0x00000008 | ||
| 932 | #define SERACC_ODT 0x00000010 /* only CS4630 */ | ||
| 933 | #endif | ||
| 934 | |||
| 935 | /* | ||
| 936 | * The following defines are for the flags in the AC97 control register 2. | ||
| 937 | */ | ||
| 938 | #ifndef NO_CS4612 | ||
| 939 | #define ACCTL2_RSTN 0x00000001 | ||
| 940 | #define ACCTL2_ESYN 0x00000002 | ||
| 941 | #define ACCTL2_VFRM 0x00000004 | ||
| 942 | #define ACCTL2_DCV 0x00000008 | ||
| 943 | #define ACCTL2_CRW 0x00000010 | ||
| 944 | #define ACCTL2_ASYN 0x00000020 | ||
| 945 | #endif | ||
| 946 | |||
| 947 | /* | ||
| 948 | * The following defines are for the flags in the AC97 status register 2. | ||
| 949 | */ | ||
| 950 | #ifndef NO_CS4612 | ||
| 951 | #define ACSTS2_CRDY 0x00000001 | ||
| 952 | #define ACSTS2_VSTS 0x00000002 | ||
| 953 | #endif | ||
| 954 | |||
| 955 | /* | ||
| 956 | * The following defines are for the flags in the AC97 output slot valid | ||
| 957 | * register 2. | ||
| 958 | */ | ||
| 959 | #ifndef NO_CS4612 | ||
| 960 | #define ACOSV2_SLV3 0x00000001 | ||
| 961 | #define ACOSV2_SLV4 0x00000002 | ||
| 962 | #define ACOSV2_SLV5 0x00000004 | ||
| 963 | #define ACOSV2_SLV6 0x00000008 | ||
| 964 | #define ACOSV2_SLV7 0x00000010 | ||
| 965 | #define ACOSV2_SLV8 0x00000020 | ||
| 966 | #define ACOSV2_SLV9 0x00000040 | ||
| 967 | #define ACOSV2_SLV10 0x00000080 | ||
| 968 | #define ACOSV2_SLV11 0x00000100 | ||
| 969 | #define ACOSV2_SLV12 0x00000200 | ||
| 970 | #endif | ||
| 971 | |||
| 972 | /* | ||
| 973 | * The following defines are for the flags in the AC97 command address | ||
| 974 | * register 2. | ||
| 975 | */ | ||
| 976 | #ifndef NO_CS4612 | ||
| 977 | #define ACCAD2_CI_MASK 0x0000007F | ||
| 978 | #define ACCAD2_CI_SHIFT 0 | ||
| 979 | #endif | ||
| 980 | |||
| 981 | /* | ||
| 982 | * The following defines are for the flags in the AC97 command data register | ||
| 983 | * 2. | ||
| 984 | */ | ||
| 985 | #ifndef NO_CS4612 | ||
| 986 | #define ACCDA2_CD_MASK 0x0000FFFF | ||
| 987 | #define ACCDA2_CD_SHIFT 0 | ||
| 988 | #endif | ||
| 989 | |||
| 990 | /* | ||
| 991 | * The following defines are for the flags in the AC97 input slot valid | ||
| 992 | * register 2. | ||
| 993 | */ | ||
| 994 | #ifndef NO_CS4612 | ||
| 995 | #define ACISV2_ISV3 0x00000001 | ||
| 996 | #define ACISV2_ISV4 0x00000002 | ||
| 997 | #define ACISV2_ISV5 0x00000004 | ||
| 998 | #define ACISV2_ISV6 0x00000008 | ||
| 999 | #define ACISV2_ISV7 0x00000010 | ||
| 1000 | #define ACISV2_ISV8 0x00000020 | ||
| 1001 | #define ACISV2_ISV9 0x00000040 | ||
| 1002 | #define ACISV2_ISV10 0x00000080 | ||
| 1003 | #define ACISV2_ISV11 0x00000100 | ||
| 1004 | #define ACISV2_ISV12 0x00000200 | ||
| 1005 | #endif | ||
| 1006 | |||
| 1007 | /* | ||
| 1008 | * The following defines are for the flags in the AC97 status address | ||
| 1009 | * register 2. | ||
| 1010 | */ | ||
| 1011 | #ifndef NO_CS4612 | ||
| 1012 | #define ACSAD2_SI_MASK 0x0000007F | ||
| 1013 | #define ACSAD2_SI_SHIFT 0 | ||
| 1014 | #endif | ||
| 1015 | |||
| 1016 | /* | ||
| 1017 | * The following defines are for the flags in the AC97 status data register 2. | ||
| 1018 | */ | ||
| 1019 | #ifndef NO_CS4612 | ||
| 1020 | #define ACSDA2_SD_MASK 0x0000FFFF | ||
| 1021 | #define ACSDA2_SD_SHIFT 0 | ||
| 1022 | #endif | ||
| 1023 | |||
| 1024 | /* | ||
| 1025 | * The following defines are for the flags in the I/O trap address and control | ||
| 1026 | * registers (all 12). | ||
| 1027 | */ | ||
| 1028 | #ifndef NO_CS4612 | ||
| 1029 | #define IOTAC_SA_MASK 0x0000FFFF | ||
| 1030 | #define IOTAC_MSK_MASK 0x000F0000 | ||
| 1031 | #define IOTAC_IODC_MASK 0x06000000 | ||
| 1032 | #define IOTAC_IODC_16_BIT 0x00000000 | ||
| 1033 | #define IOTAC_IODC_10_BIT 0x02000000 | ||
| 1034 | #define IOTAC_IODC_12_BIT 0x04000000 | ||
| 1035 | #define IOTAC_WSPI 0x08000000 | ||
| 1036 | #define IOTAC_RSPI 0x10000000 | ||
| 1037 | #define IOTAC_WSE 0x20000000 | ||
| 1038 | #define IOTAC_WE 0x40000000 | ||
| 1039 | #define IOTAC_RE 0x80000000 | ||
| 1040 | #define IOTAC_SA_SHIFT 0 | ||
| 1041 | #define IOTAC_MSK_SHIFT 16 | ||
| 1042 | #endif | ||
| 1043 | |||
| 1044 | /* | ||
| 1045 | * The following defines are for the flags in the I/O trap fast read registers | ||
| 1046 | * (all 8). | ||
| 1047 | */ | ||
| 1048 | #ifndef NO_CS4612 | ||
| 1049 | #define IOTFR_D_MASK 0x0000FFFF | ||
| 1050 | #define IOTFR_A_MASK 0x000F0000 | ||
| 1051 | #define IOTFR_R_MASK 0x0F000000 | ||
| 1052 | #define IOTFR_ALL 0x40000000 | ||
| 1053 | #define IOTFR_VL 0x80000000 | ||
| 1054 | #define IOTFR_D_SHIFT 0 | ||
| 1055 | #define IOTFR_A_SHIFT 16 | ||
| 1056 | #define IOTFR_R_SHIFT 24 | ||
| 1057 | #endif | ||
| 1058 | |||
| 1059 | /* | ||
| 1060 | * The following defines are for the flags in the I/O trap FIFO register. | ||
| 1061 | */ | ||
| 1062 | #ifndef NO_CS4612 | ||
| 1063 | #define IOTFIFO_BA_MASK 0x00003FFF | ||
| 1064 | #define IOTFIFO_S_MASK 0x00FF0000 | ||
| 1065 | #define IOTFIFO_OF 0x40000000 | ||
| 1066 | #define IOTFIFO_SPIOF 0x80000000 | ||
| 1067 | #define IOTFIFO_BA_SHIFT 0 | ||
| 1068 | #define IOTFIFO_S_SHIFT 16 | ||
| 1069 | #endif | ||
| 1070 | |||
| 1071 | /* | ||
| 1072 | * The following defines are for the flags in the I/O trap retry read data | ||
| 1073 | * register. | ||
| 1074 | */ | ||
| 1075 | #ifndef NO_CS4612 | ||
| 1076 | #define IOTRRD_D_MASK 0x0000FFFF | ||
| 1077 | #define IOTRRD_RDV 0x80000000 | ||
| 1078 | #define IOTRRD_D_SHIFT 0 | ||
| 1079 | #endif | ||
| 1080 | |||
| 1081 | /* | ||
| 1082 | * The following defines are for the flags in the I/O trap FIFO pointer | ||
| 1083 | * register. | ||
| 1084 | */ | ||
| 1085 | #ifndef NO_CS4612 | ||
| 1086 | #define IOTFP_CA_MASK 0x00003FFF | ||
| 1087 | #define IOTFP_PA_MASK 0x3FFF0000 | ||
| 1088 | #define IOTFP_CA_SHIFT 0 | ||
| 1089 | #define IOTFP_PA_SHIFT 16 | ||
| 1090 | #endif | ||
| 1091 | |||
| 1092 | /* | ||
| 1093 | * The following defines are for the flags in the I/O trap control register. | ||
| 1094 | */ | ||
| 1095 | #ifndef NO_CS4612 | ||
| 1096 | #define IOTCR_ITD 0x00000001 | ||
| 1097 | #define IOTCR_HRV 0x00000002 | ||
| 1098 | #define IOTCR_SRV 0x00000004 | ||
| 1099 | #define IOTCR_DTI 0x00000008 | ||
| 1100 | #define IOTCR_DFI 0x00000010 | ||
| 1101 | #define IOTCR_DDP 0x00000020 | ||
| 1102 | #define IOTCR_JTE 0x00000040 | ||
| 1103 | #define IOTCR_PPE 0x00000080 | ||
| 1104 | #endif | ||
| 1105 | |||
| 1106 | /* | ||
| 1107 | * The following defines are for the flags in the direct PCI data register. | ||
| 1108 | */ | ||
| 1109 | #ifndef NO_CS4612 | ||
| 1110 | #define DPCID_D_MASK 0xFFFFFFFF | ||
| 1111 | #define DPCID_D_SHIFT 0 | ||
| 1112 | #endif | ||
| 1113 | |||
| 1114 | /* | ||
| 1115 | * The following defines are for the flags in the direct PCI address register. | ||
| 1116 | */ | ||
| 1117 | #ifndef NO_CS4612 | ||
| 1118 | #define DPCIA_A_MASK 0xFFFFFFFF | ||
| 1119 | #define DPCIA_A_SHIFT 0 | ||
| 1120 | #endif | ||
| 1121 | |||
| 1122 | /* | ||
| 1123 | * The following defines are for the flags in the direct PCI command register. | ||
| 1124 | */ | ||
| 1125 | #ifndef NO_CS4612 | ||
| 1126 | #define DPCIC_C_MASK 0x0000000F | ||
| 1127 | #define DPCIC_C_IOREAD 0x00000002 | ||
| 1128 | #define DPCIC_C_IOWRITE 0x00000003 | ||
| 1129 | #define DPCIC_BE_MASK 0x000000F0 | ||
| 1130 | #endif | ||
| 1131 | |||
| 1132 | /* | ||
| 1133 | * The following defines are for the flags in the PC/PCI request register. | ||
| 1134 | */ | ||
| 1135 | #ifndef NO_CS4612 | ||
| 1136 | #define PCPCIR_RDC_MASK 0x00000007 | ||
| 1137 | #define PCPCIR_C_MASK 0x00007000 | ||
| 1138 | #define PCPCIR_REQ 0x00008000 | ||
| 1139 | #define PCPCIR_RDC_SHIFT 0 | ||
| 1140 | #define PCPCIR_C_SHIFT 12 | ||
| 1141 | #endif | ||
| 1142 | |||
| 1143 | /* | ||
| 1144 | * The following defines are for the flags in the PC/PCI grant register. | ||
| 1145 | */ | ||
| 1146 | #ifndef NO_CS4612 | ||
| 1147 | #define PCPCIG_GDC_MASK 0x00000007 | ||
| 1148 | #define PCPCIG_VL 0x00008000 | ||
| 1149 | #define PCPCIG_GDC_SHIFT 0 | ||
| 1150 | #endif | ||
| 1151 | |||
| 1152 | /* | ||
| 1153 | * The following defines are for the flags in the PC/PCI master enable | ||
| 1154 | * register. | ||
| 1155 | */ | ||
| 1156 | #ifndef NO_CS4612 | ||
| 1157 | #define PCPCIEN_EN 0x00000001 | ||
| 1158 | #endif | ||
| 1159 | |||
| 1160 | /* | ||
| 1161 | * The following defines are for the flags in the extended PCI power | ||
| 1162 | * management control register. | ||
| 1163 | */ | ||
| 1164 | #ifndef NO_CS4612 | ||
| 1165 | #define EPCIPMC_GWU 0x00000001 | ||
| 1166 | #define EPCIPMC_FSPC 0x00000002 | ||
| 1167 | #endif | ||
| 1168 | |||
| 1169 | /* | ||
| 1170 | * The following defines are for the flags in the SP control register. | ||
| 1171 | */ | ||
| 1172 | #define SPCR_RUN 0x00000001 | ||
| 1173 | #define SPCR_STPFR 0x00000002 | ||
| 1174 | #define SPCR_RUNFR 0x00000004 | ||
| 1175 | #define SPCR_TICK 0x00000008 | ||
| 1176 | #define SPCR_DRQEN 0x00000020 | ||
| 1177 | #define SPCR_RSTSP 0x00000040 | ||
| 1178 | #define SPCR_OREN 0x00000080 | ||
| 1179 | #ifndef NO_CS4612 | ||
| 1180 | #define SPCR_PCIINT 0x00000100 | ||
| 1181 | #define SPCR_OINTD 0x00000200 | ||
| 1182 | #define SPCR_CRE 0x00008000 | ||
| 1183 | #endif | ||
| 1184 | |||
| 1185 | /* | ||
| 1186 | * The following defines are for the flags in the debug index register. | ||
| 1187 | */ | ||
| 1188 | #define DREG_REGID_MASK 0x0000007F | ||
| 1189 | #define DREG_DEBUG 0x00000080 | ||
| 1190 | #define DREG_RGBK_MASK 0x00000700 | ||
| 1191 | #define DREG_TRAP 0x00000800 | ||
| 1192 | #if !defined(NO_CS4612) | ||
| 1193 | #if !defined(NO_CS4615) | ||
| 1194 | #define DREG_TRAPX 0x00001000 | ||
| 1195 | #endif | ||
| 1196 | #endif | ||
| 1197 | #define DREG_REGID_SHIFT 0 | ||
| 1198 | #define DREG_RGBK_SHIFT 8 | ||
| 1199 | #define DREG_RGBK_REGID_MASK 0x0000077F | ||
| 1200 | #define DREG_REGID_R0 0x00000010 | ||
| 1201 | #define DREG_REGID_R1 0x00000011 | ||
| 1202 | #define DREG_REGID_R2 0x00000012 | ||
| 1203 | #define DREG_REGID_R3 0x00000013 | ||
| 1204 | #define DREG_REGID_R4 0x00000014 | ||
| 1205 | #define DREG_REGID_R5 0x00000015 | ||
| 1206 | #define DREG_REGID_R6 0x00000016 | ||
| 1207 | #define DREG_REGID_R7 0x00000017 | ||
| 1208 | #define DREG_REGID_R8 0x00000018 | ||
| 1209 | #define DREG_REGID_R9 0x00000019 | ||
| 1210 | #define DREG_REGID_RA 0x0000001A | ||
| 1211 | #define DREG_REGID_RB 0x0000001B | ||
| 1212 | #define DREG_REGID_RC 0x0000001C | ||
| 1213 | #define DREG_REGID_RD 0x0000001D | ||
| 1214 | #define DREG_REGID_RE 0x0000001E | ||
| 1215 | #define DREG_REGID_RF 0x0000001F | ||
| 1216 | #define DREG_REGID_RA_BUS_LOW 0x00000020 | ||
| 1217 | #define DREG_REGID_RA_BUS_HIGH 0x00000038 | ||
| 1218 | #define DREG_REGID_YBUS_LOW 0x00000050 | ||
| 1219 | #define DREG_REGID_YBUS_HIGH 0x00000058 | ||
| 1220 | #define DREG_REGID_TRAP_0 0x00000100 | ||
| 1221 | #define DREG_REGID_TRAP_1 0x00000101 | ||
| 1222 | #define DREG_REGID_TRAP_2 0x00000102 | ||
| 1223 | #define DREG_REGID_TRAP_3 0x00000103 | ||
| 1224 | #define DREG_REGID_TRAP_4 0x00000104 | ||
| 1225 | #define DREG_REGID_TRAP_5 0x00000105 | ||
| 1226 | #define DREG_REGID_TRAP_6 0x00000106 | ||
| 1227 | #define DREG_REGID_TRAP_7 0x00000107 | ||
| 1228 | #define DREG_REGID_INDIRECT_ADDRESS 0x0000010E | ||
| 1229 | #define DREG_REGID_TOP_OF_STACK 0x0000010F | ||
| 1230 | #if !defined(NO_CS4612) | ||
| 1231 | #if !defined(NO_CS4615) | ||
| 1232 | #define DREG_REGID_TRAP_8 0x00000110 | ||
| 1233 | #define DREG_REGID_TRAP_9 0x00000111 | ||
| 1234 | #define DREG_REGID_TRAP_10 0x00000112 | ||
| 1235 | #define DREG_REGID_TRAP_11 0x00000113 | ||
| 1236 | #define DREG_REGID_TRAP_12 0x00000114 | ||
| 1237 | #define DREG_REGID_TRAP_13 0x00000115 | ||
| 1238 | #define DREG_REGID_TRAP_14 0x00000116 | ||
| 1239 | #define DREG_REGID_TRAP_15 0x00000117 | ||
| 1240 | #define DREG_REGID_TRAP_16 0x00000118 | ||
| 1241 | #define DREG_REGID_TRAP_17 0x00000119 | ||
| 1242 | #define DREG_REGID_TRAP_18 0x0000011A | ||
| 1243 | #define DREG_REGID_TRAP_19 0x0000011B | ||
| 1244 | #define DREG_REGID_TRAP_20 0x0000011C | ||
| 1245 | #define DREG_REGID_TRAP_21 0x0000011D | ||
| 1246 | #define DREG_REGID_TRAP_22 0x0000011E | ||
| 1247 | #define DREG_REGID_TRAP_23 0x0000011F | ||
| 1248 | #endif | ||
| 1249 | #endif | ||
| 1250 | #define DREG_REGID_RSA0_LOW 0x00000200 | ||
| 1251 | #define DREG_REGID_RSA0_HIGH 0x00000201 | ||
| 1252 | #define DREG_REGID_RSA1_LOW 0x00000202 | ||
| 1253 | #define DREG_REGID_RSA1_HIGH 0x00000203 | ||
| 1254 | #define DREG_REGID_RSA2 0x00000204 | ||
| 1255 | #define DREG_REGID_RSA3 0x00000205 | ||
| 1256 | #define DREG_REGID_RSI0_LOW 0x00000206 | ||
| 1257 | #define DREG_REGID_RSI0_HIGH 0x00000207 | ||
| 1258 | #define DREG_REGID_RSI1 0x00000208 | ||
| 1259 | #define DREG_REGID_RSI2 0x00000209 | ||
| 1260 | #define DREG_REGID_SAGUSTATUS 0x0000020A | ||
| 1261 | #define DREG_REGID_RSCONFIG01_LOW 0x0000020B | ||
| 1262 | #define DREG_REGID_RSCONFIG01_HIGH 0x0000020C | ||
| 1263 | #define DREG_REGID_RSCONFIG23_LOW 0x0000020D | ||
| 1264 | #define DREG_REGID_RSCONFIG23_HIGH 0x0000020E | ||
| 1265 | #define DREG_REGID_RSDMA01E 0x0000020F | ||
| 1266 | #define DREG_REGID_RSDMA23E 0x00000210 | ||
| 1267 | #define DREG_REGID_RSD0_LOW 0x00000211 | ||
| 1268 | #define DREG_REGID_RSD0_HIGH 0x00000212 | ||
| 1269 | #define DREG_REGID_RSD1_LOW 0x00000213 | ||
| 1270 | #define DREG_REGID_RSD1_HIGH 0x00000214 | ||
| 1271 | #define DREG_REGID_RSD2_LOW 0x00000215 | ||
| 1272 | #define DREG_REGID_RSD2_HIGH 0x00000216 | ||
| 1273 | #define DREG_REGID_RSD3_LOW 0x00000217 | ||
| 1274 | #define DREG_REGID_RSD3_HIGH 0x00000218 | ||
| 1275 | #define DREG_REGID_SRAR_HIGH 0x0000021A | ||
| 1276 | #define DREG_REGID_SRAR_LOW 0x0000021B | ||
| 1277 | #define DREG_REGID_DMA_STATE 0x0000021C | ||
| 1278 | #define DREG_REGID_CURRENT_DMA_STREAM 0x0000021D | ||
| 1279 | #define DREG_REGID_NEXT_DMA_STREAM 0x0000021E | ||
| 1280 | #define DREG_REGID_CPU_STATUS 0x00000300 | ||
| 1281 | #define DREG_REGID_MAC_MODE 0x00000301 | ||
| 1282 | #define DREG_REGID_STACK_AND_REPEAT 0x00000302 | ||
| 1283 | #define DREG_REGID_INDEX0 0x00000304 | ||
| 1284 | #define DREG_REGID_INDEX1 0x00000305 | ||
| 1285 | #define DREG_REGID_DMA_STATE_0_3 0x00000400 | ||
| 1286 | #define DREG_REGID_DMA_STATE_4_7 0x00000404 | ||
| 1287 | #define DREG_REGID_DMA_STATE_8_11 0x00000408 | ||
| 1288 | #define DREG_REGID_DMA_STATE_12_15 0x0000040C | ||
| 1289 | #define DREG_REGID_DMA_STATE_16_19 0x00000410 | ||
| 1290 | #define DREG_REGID_DMA_STATE_20_23 0x00000414 | ||
| 1291 | #define DREG_REGID_DMA_STATE_24_27 0x00000418 | ||
| 1292 | #define DREG_REGID_DMA_STATE_28_31 0x0000041C | ||
| 1293 | #define DREG_REGID_DMA_STATE_32_35 0x00000420 | ||
| 1294 | #define DREG_REGID_DMA_STATE_36_39 0x00000424 | ||
| 1295 | #define DREG_REGID_DMA_STATE_40_43 0x00000428 | ||
| 1296 | #define DREG_REGID_DMA_STATE_44_47 0x0000042C | ||
| 1297 | #define DREG_REGID_DMA_STATE_48_51 0x00000430 | ||
| 1298 | #define DREG_REGID_DMA_STATE_52_55 0x00000434 | ||
| 1299 | #define DREG_REGID_DMA_STATE_56_59 0x00000438 | ||
| 1300 | #define DREG_REGID_DMA_STATE_60_63 0x0000043C | ||
| 1301 | #define DREG_REGID_DMA_STATE_64_67 0x00000440 | ||
| 1302 | #define DREG_REGID_DMA_STATE_68_71 0x00000444 | ||
| 1303 | #define DREG_REGID_DMA_STATE_72_75 0x00000448 | ||
| 1304 | #define DREG_REGID_DMA_STATE_76_79 0x0000044C | ||
| 1305 | #define DREG_REGID_DMA_STATE_80_83 0x00000450 | ||
| 1306 | #define DREG_REGID_DMA_STATE_84_87 0x00000454 | ||
| 1307 | #define DREG_REGID_DMA_STATE_88_91 0x00000458 | ||
| 1308 | #define DREG_REGID_DMA_STATE_92_95 0x0000045C | ||
| 1309 | #define DREG_REGID_TRAP_SELECT 0x00000500 | ||
| 1310 | #define DREG_REGID_TRAP_WRITE_0 0x00000500 | ||
| 1311 | #define DREG_REGID_TRAP_WRITE_1 0x00000501 | ||
| 1312 | #define DREG_REGID_TRAP_WRITE_2 0x00000502 | ||
| 1313 | #define DREG_REGID_TRAP_WRITE_3 0x00000503 | ||
| 1314 | #define DREG_REGID_TRAP_WRITE_4 0x00000504 | ||
| 1315 | #define DREG_REGID_TRAP_WRITE_5 0x00000505 | ||
| 1316 | #define DREG_REGID_TRAP_WRITE_6 0x00000506 | ||
| 1317 | #define DREG_REGID_TRAP_WRITE_7 0x00000507 | ||
| 1318 | #if !defined(NO_CS4612) | ||
| 1319 | #if !defined(NO_CS4615) | ||
| 1320 | #define DREG_REGID_TRAP_WRITE_8 0x00000510 | ||
| 1321 | #define DREG_REGID_TRAP_WRITE_9 0x00000511 | ||
| 1322 | #define DREG_REGID_TRAP_WRITE_10 0x00000512 | ||
| 1323 | #define DREG_REGID_TRAP_WRITE_11 0x00000513 | ||
| 1324 | #define DREG_REGID_TRAP_WRITE_12 0x00000514 | ||
| 1325 | #define DREG_REGID_TRAP_WRITE_13 0x00000515 | ||
| 1326 | #define DREG_REGID_TRAP_WRITE_14 0x00000516 | ||
| 1327 | #define DREG_REGID_TRAP_WRITE_15 0x00000517 | ||
| 1328 | #define DREG_REGID_TRAP_WRITE_16 0x00000518 | ||
| 1329 | #define DREG_REGID_TRAP_WRITE_17 0x00000519 | ||
| 1330 | #define DREG_REGID_TRAP_WRITE_18 0x0000051A | ||
| 1331 | #define DREG_REGID_TRAP_WRITE_19 0x0000051B | ||
| 1332 | #define DREG_REGID_TRAP_WRITE_20 0x0000051C | ||
| 1333 | #define DREG_REGID_TRAP_WRITE_21 0x0000051D | ||
| 1334 | #define DREG_REGID_TRAP_WRITE_22 0x0000051E | ||
| 1335 | #define DREG_REGID_TRAP_WRITE_23 0x0000051F | ||
| 1336 | #endif | ||
| 1337 | #endif | ||
| 1338 | #define DREG_REGID_MAC0_ACC0_LOW 0x00000600 | ||
| 1339 | #define DREG_REGID_MAC0_ACC1_LOW 0x00000601 | ||
| 1340 | #define DREG_REGID_MAC0_ACC2_LOW 0x00000602 | ||
| 1341 | #define DREG_REGID_MAC0_ACC3_LOW 0x00000603 | ||
| 1342 | #define DREG_REGID_MAC1_ACC0_LOW 0x00000604 | ||
| 1343 | #define DREG_REGID_MAC1_ACC1_LOW 0x00000605 | ||
| 1344 | #define DREG_REGID_MAC1_ACC2_LOW 0x00000606 | ||
| 1345 | #define DREG_REGID_MAC1_ACC3_LOW 0x00000607 | ||
| 1346 | #define DREG_REGID_MAC0_ACC0_MID 0x00000608 | ||
| 1347 | #define DREG_REGID_MAC0_ACC1_MID 0x00000609 | ||
| 1348 | #define DREG_REGID_MAC0_ACC2_MID 0x0000060A | ||
| 1349 | #define DREG_REGID_MAC0_ACC3_MID 0x0000060B | ||
| 1350 | #define DREG_REGID_MAC1_ACC0_MID 0x0000060C | ||
| 1351 | #define DREG_REGID_MAC1_ACC1_MID 0x0000060D | ||
| 1352 | #define DREG_REGID_MAC1_ACC2_MID 0x0000060E | ||
| 1353 | #define DREG_REGID_MAC1_ACC3_MID 0x0000060F | ||
| 1354 | #define DREG_REGID_MAC0_ACC0_HIGH 0x00000610 | ||
| 1355 | #define DREG_REGID_MAC0_ACC1_HIGH 0x00000611 | ||
| 1356 | #define DREG_REGID_MAC0_ACC2_HIGH 0x00000612 | ||
| 1357 | #define DREG_REGID_MAC0_ACC3_HIGH 0x00000613 | ||
| 1358 | #define DREG_REGID_MAC1_ACC0_HIGH 0x00000614 | ||
| 1359 | #define DREG_REGID_MAC1_ACC1_HIGH 0x00000615 | ||
| 1360 | #define DREG_REGID_MAC1_ACC2_HIGH 0x00000616 | ||
| 1361 | #define DREG_REGID_MAC1_ACC3_HIGH 0x00000617 | ||
| 1362 | #define DREG_REGID_RSHOUT_LOW 0x00000620 | ||
| 1363 | #define DREG_REGID_RSHOUT_MID 0x00000628 | ||
| 1364 | #define DREG_REGID_RSHOUT_HIGH 0x00000630 | ||
| 1365 | |||
| 1366 | /* | ||
| 1367 | * The following defines are for the flags in the DMA stream requestor write | ||
| 1368 | */ | ||
| 1369 | #define DSRWP_DSR_MASK 0x0000000F | ||
| 1370 | #define DSRWP_DSR_BG_RQ 0x00000001 | ||
| 1371 | #define DSRWP_DSR_PRIORITY_MASK 0x00000006 | ||
| 1372 | #define DSRWP_DSR_PRIORITY_0 0x00000000 | ||
| 1373 | #define DSRWP_DSR_PRIORITY_1 0x00000002 | ||
| 1374 | #define DSRWP_DSR_PRIORITY_2 0x00000004 | ||
| 1375 | #define DSRWP_DSR_PRIORITY_3 0x00000006 | ||
| 1376 | #define DSRWP_DSR_RQ_PENDING 0x00000008 | ||
| 1377 | |||
| 1378 | /* | ||
| 1379 | * The following defines are for the flags in the trap write port register. | ||
| 1380 | */ | ||
| 1381 | #define TWPR_TW_MASK 0x0000FFFF | ||
| 1382 | #define TWPR_TW_SHIFT 0 | ||
| 1383 | |||
| 1384 | /* | ||
| 1385 | * The following defines are for the flags in the stack pointer write | ||
| 1386 | * register. | ||
| 1387 | */ | ||
| 1388 | #define SPWR_STKP_MASK 0x0000000F | ||
| 1389 | #define SPWR_STKP_SHIFT 0 | ||
| 1390 | |||
| 1391 | /* | ||
| 1392 | * The following defines are for the flags in the SP interrupt register. | ||
| 1393 | */ | ||
| 1394 | #define SPIR_FRI 0x00000001 | ||
| 1395 | #define SPIR_DOI 0x00000002 | ||
| 1396 | #define SPIR_GPI2 0x00000004 | ||
| 1397 | #define SPIR_GPI3 0x00000008 | ||
| 1398 | #define SPIR_IP0 0x00000010 | ||
| 1399 | #define SPIR_IP1 0x00000020 | ||
| 1400 | #define SPIR_IP2 0x00000040 | ||
| 1401 | #define SPIR_IP3 0x00000080 | ||
| 1402 | |||
| 1403 | /* | ||
| 1404 | * The following defines are for the flags in the functional group 1 register. | ||
| 1405 | */ | ||
| 1406 | #define FGR1_F1S_MASK 0x0000FFFF | ||
| 1407 | #define FGR1_F1S_SHIFT 0 | ||
| 1408 | |||
| 1409 | /* | ||
| 1410 | * The following defines are for the flags in the SP clock status register. | ||
| 1411 | */ | ||
| 1412 | #define SPCS_FRI 0x00000001 | ||
| 1413 | #define SPCS_DOI 0x00000002 | ||
| 1414 | #define SPCS_GPI2 0x00000004 | ||
| 1415 | #define SPCS_GPI3 0x00000008 | ||
| 1416 | #define SPCS_IP0 0x00000010 | ||
| 1417 | #define SPCS_IP1 0x00000020 | ||
| 1418 | #define SPCS_IP2 0x00000040 | ||
| 1419 | #define SPCS_IP3 0x00000080 | ||
| 1420 | #define SPCS_SPRUN 0x00000100 | ||
| 1421 | #define SPCS_SLEEP 0x00000200 | ||
| 1422 | #define SPCS_FG 0x00000400 | ||
| 1423 | #define SPCS_ORUN 0x00000800 | ||
| 1424 | #define SPCS_IRQ 0x00001000 | ||
| 1425 | #define SPCS_FGN_MASK 0x0000E000 | ||
| 1426 | #define SPCS_FGN_SHIFT 13 | ||
| 1427 | |||
| 1428 | /* | ||
| 1429 | * The following defines are for the flags in the SP DMA requestor status | ||
| 1430 | * register. | ||
| 1431 | */ | ||
| 1432 | #define SDSR_DCS_MASK 0x000000FF | ||
| 1433 | #define SDSR_DCS_SHIFT 0 | ||
| 1434 | #define SDSR_DCS_NONE 0x00000007 | ||
| 1435 | |||
| 1436 | /* | ||
| 1437 | * The following defines are for the flags in the frame timer register. | ||
| 1438 | */ | ||
| 1439 | #define FRMT_FTV_MASK 0x0000FFFF | ||
| 1440 | #define FRMT_FTV_SHIFT 0 | ||
| 1441 | |||
| 1442 | /* | ||
| 1443 | * The following defines are for the flags in the frame timer current count | ||
| 1444 | * register. | ||
| 1445 | */ | ||
| 1446 | #define FRCC_FCC_MASK 0x0000FFFF | ||
| 1447 | #define FRCC_FCC_SHIFT 0 | ||
| 1448 | |||
| 1449 | /* | ||
| 1450 | * The following defines are for the flags in the frame timer save count | ||
| 1451 | * register. | ||
| 1452 | */ | ||
| 1453 | #define FRSC_FCS_MASK 0x0000FFFF | ||
| 1454 | #define FRSC_FCS_SHIFT 0 | ||
| 1455 | |||
| 1456 | /* | ||
| 1457 | * The following define the various flags stored in the scatter/gather | ||
| 1458 | * descriptors. | ||
| 1459 | */ | ||
| 1460 | #define DMA_SG_NEXT_ENTRY_MASK 0x00000FF8 | ||
| 1461 | #define DMA_SG_SAMPLE_END_MASK 0x0FFF0000 | ||
| 1462 | #define DMA_SG_SAMPLE_END_FLAG 0x10000000 | ||
| 1463 | #define DMA_SG_LOOP_END_FLAG 0x20000000 | ||
| 1464 | #define DMA_SG_SIGNAL_END_FLAG 0x40000000 | ||
| 1465 | #define DMA_SG_SIGNAL_PAGE_FLAG 0x80000000 | ||
| 1466 | #define DMA_SG_NEXT_ENTRY_SHIFT 3 | ||
| 1467 | #define DMA_SG_SAMPLE_END_SHIFT 16 | ||
| 1468 | |||
| 1469 | /* | ||
| 1470 | * The following define the offsets of the fields within the on-chip generic | ||
| 1471 | * DMA requestor. | ||
| 1472 | */ | ||
| 1473 | #define DMA_RQ_CONTROL1 0x00000000 | ||
| 1474 | #define DMA_RQ_CONTROL2 0x00000004 | ||
| 1475 | #define DMA_RQ_SOURCE_ADDR 0x00000008 | ||
| 1476 | #define DMA_RQ_DESTINATION_ADDR 0x0000000C | ||
| 1477 | #define DMA_RQ_NEXT_PAGE_ADDR 0x00000010 | ||
| 1478 | #define DMA_RQ_NEXT_PAGE_SGDESC 0x00000014 | ||
| 1479 | #define DMA_RQ_LOOP_START_ADDR 0x00000018 | ||
| 1480 | #define DMA_RQ_POST_LOOP_ADDR 0x0000001C | ||
| 1481 | #define DMA_RQ_PAGE_MAP_ADDR 0x00000020 | ||
| 1482 | |||
| 1483 | /* | ||
| 1484 | * The following defines are for the flags in the first control word of the | ||
| 1485 | * on-chip generic DMA requestor. | ||
| 1486 | */ | ||
| 1487 | #define DMA_RQ_C1_COUNT_MASK 0x000003FF | ||
| 1488 | #define DMA_RQ_C1_DESTINATION_SCATTER 0x00001000 | ||
| 1489 | #define DMA_RQ_C1_SOURCE_GATHER 0x00002000 | ||
| 1490 | #define DMA_RQ_C1_DONE_FLAG 0x00004000 | ||
| 1491 | #define DMA_RQ_C1_OPTIMIZE_STATE 0x00008000 | ||
| 1492 | #define DMA_RQ_C1_SAMPLE_END_STATE_MASK 0x00030000 | ||
| 1493 | #define DMA_RQ_C1_FULL_PAGE 0x00000000 | ||
| 1494 | #define DMA_RQ_C1_BEFORE_SAMPLE_END 0x00010000 | ||
| 1495 | #define DMA_RQ_C1_PAGE_MAP_ERROR 0x00020000 | ||
| 1496 | #define DMA_RQ_C1_AT_SAMPLE_END 0x00030000 | ||
| 1497 | #define DMA_RQ_C1_LOOP_END_STATE_MASK 0x000C0000 | ||
| 1498 | #define DMA_RQ_C1_NOT_LOOP_END 0x00000000 | ||
| 1499 | #define DMA_RQ_C1_BEFORE_LOOP_END 0x00040000 | ||
| 1500 | #define DMA_RQ_C1_2PAGE_LOOP_BEGIN 0x00080000 | ||
| 1501 | #define DMA_RQ_C1_LOOP_BEGIN 0x000C0000 | ||
| 1502 | #define DMA_RQ_C1_PAGE_MAP_MASK 0x00300000 | ||
| 1503 | #define DMA_RQ_C1_PM_NONE_PENDING 0x00000000 | ||
| 1504 | #define DMA_RQ_C1_PM_NEXT_PENDING 0x00100000 | ||
| 1505 | #define DMA_RQ_C1_PM_RESERVED 0x00200000 | ||
| 1506 | #define DMA_RQ_C1_PM_LOOP_NEXT_PENDING 0x00300000 | ||
| 1507 | #define DMA_RQ_C1_WRITEBACK_DEST_FLAG 0x00400000 | ||
| 1508 | #define DMA_RQ_C1_WRITEBACK_SRC_FLAG 0x00800000 | ||
| 1509 | #define DMA_RQ_C1_DEST_SIZE_MASK 0x07000000 | ||
| 1510 | #define DMA_RQ_C1_DEST_LINEAR 0x00000000 | ||
| 1511 | #define DMA_RQ_C1_DEST_MOD16 0x01000000 | ||
| 1512 | #define DMA_RQ_C1_DEST_MOD32 0x02000000 | ||
| 1513 | #define DMA_RQ_C1_DEST_MOD64 0x03000000 | ||
| 1514 | #define DMA_RQ_C1_DEST_MOD128 0x04000000 | ||
| 1515 | #define DMA_RQ_C1_DEST_MOD256 0x05000000 | ||
| 1516 | #define DMA_RQ_C1_DEST_MOD512 0x06000000 | ||
| 1517 | #define DMA_RQ_C1_DEST_MOD1024 0x07000000 | ||
| 1518 | #define DMA_RQ_C1_DEST_ON_HOST 0x08000000 | ||
| 1519 | #define DMA_RQ_C1_SOURCE_SIZE_MASK 0x70000000 | ||
| 1520 | #define DMA_RQ_C1_SOURCE_LINEAR 0x00000000 | ||
| 1521 | #define DMA_RQ_C1_SOURCE_MOD16 0x10000000 | ||
| 1522 | #define DMA_RQ_C1_SOURCE_MOD32 0x20000000 | ||
| 1523 | #define DMA_RQ_C1_SOURCE_MOD64 0x30000000 | ||
| 1524 | #define DMA_RQ_C1_SOURCE_MOD128 0x40000000 | ||
| 1525 | #define DMA_RQ_C1_SOURCE_MOD256 0x50000000 | ||
| 1526 | #define DMA_RQ_C1_SOURCE_MOD512 0x60000000 | ||
| 1527 | #define DMA_RQ_C1_SOURCE_MOD1024 0x70000000 | ||
| 1528 | #define DMA_RQ_C1_SOURCE_ON_HOST 0x80000000 | ||
| 1529 | #define DMA_RQ_C1_COUNT_SHIFT 0 | ||
| 1530 | |||
| 1531 | /* | ||
| 1532 | * The following defines are for the flags in the second control word of the | ||
| 1533 | * on-chip generic DMA requestor. | ||
| 1534 | */ | ||
| 1535 | #define DMA_RQ_C2_VIRTUAL_CHANNEL_MASK 0x0000003F | ||
| 1536 | #define DMA_RQ_C2_VIRTUAL_SIGNAL_MASK 0x00000300 | ||
| 1537 | #define DMA_RQ_C2_NO_VIRTUAL_SIGNAL 0x00000000 | ||
| 1538 | #define DMA_RQ_C2_SIGNAL_EVERY_DMA 0x00000100 | ||
| 1539 | #define DMA_RQ_C2_SIGNAL_SOURCE_PINGPONG 0x00000200 | ||
| 1540 | #define DMA_RQ_C2_SIGNAL_DEST_PINGPONG 0x00000300 | ||
| 1541 | #define DMA_RQ_C2_AUDIO_CONVERT_MASK 0x0000F000 | ||
| 1542 | #define DMA_RQ_C2_AC_NONE 0x00000000 | ||
| 1543 | #define DMA_RQ_C2_AC_8_TO_16_BIT 0x00001000 | ||
| 1544 | #define DMA_RQ_C2_AC_MONO_TO_STEREO 0x00002000 | ||
| 1545 | #define DMA_RQ_C2_AC_ENDIAN_CONVERT 0x00004000 | ||
| 1546 | #define DMA_RQ_C2_AC_SIGNED_CONVERT 0x00008000 | ||
| 1547 | #define DMA_RQ_C2_LOOP_END_MASK 0x0FFF0000 | ||
| 1548 | #define DMA_RQ_C2_LOOP_MASK 0x30000000 | ||
| 1549 | #define DMA_RQ_C2_NO_LOOP 0x00000000 | ||
| 1550 | #define DMA_RQ_C2_ONE_PAGE_LOOP 0x10000000 | ||
| 1551 | #define DMA_RQ_C2_TWO_PAGE_LOOP 0x20000000 | ||
| 1552 | #define DMA_RQ_C2_MULTI_PAGE_LOOP 0x30000000 | ||
| 1553 | #define DMA_RQ_C2_SIGNAL_LOOP_BACK 0x40000000 | ||
| 1554 | #define DMA_RQ_C2_SIGNAL_POST_BEGIN_PAGE 0x80000000 | ||
| 1555 | #define DMA_RQ_C2_VIRTUAL_CHANNEL_SHIFT 0 | ||
| 1556 | #define DMA_RQ_C2_LOOP_END_SHIFT 16 | ||
| 1557 | |||
| 1558 | /* | ||
| 1559 | * The following defines are for the flags in the source and destination words | ||
| 1560 | * of the on-chip generic DMA requestor. | ||
| 1561 | */ | ||
| 1562 | #define DMA_RQ_SD_ADDRESS_MASK 0x0000FFFF | ||
| 1563 | #define DMA_RQ_SD_MEMORY_ID_MASK 0x000F0000 | ||
| 1564 | #define DMA_RQ_SD_SP_PARAM_ADDR 0x00000000 | ||
| 1565 | #define DMA_RQ_SD_SP_SAMPLE_ADDR 0x00010000 | ||
| 1566 | #define DMA_RQ_SD_SP_PROGRAM_ADDR 0x00020000 | ||
| 1567 | #define DMA_RQ_SD_SP_DEBUG_ADDR 0x00030000 | ||
| 1568 | #define DMA_RQ_SD_OMNIMEM_ADDR 0x000E0000 | ||
| 1569 | #define DMA_RQ_SD_END_FLAG 0x40000000 | ||
| 1570 | #define DMA_RQ_SD_ERROR_FLAG 0x80000000 | ||
| 1571 | #define DMA_RQ_SD_ADDRESS_SHIFT 0 | ||
| 1572 | |||
| 1573 | /* | ||
| 1574 | * The following defines are for the flags in the page map address word of the | ||
| 1575 | * on-chip generic DMA requestor. | ||
| 1576 | */ | ||
| 1577 | #define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_MASK 0x00000FF8 | ||
| 1578 | #define DMA_RQ_PMA_PAGE_TABLE_MASK 0xFFFFF000 | ||
| 1579 | #define DMA_RQ_PMA_LOOP_THIRD_PAGE_ENTRY_SHIFT 3 | ||
| 1580 | #define DMA_RQ_PMA_PAGE_TABLE_SHIFT 12 | ||
| 1581 | |||
| 1582 | #define BA1_VARIDEC_BUF_1 0x000 | ||
| 1583 | |||
| 1584 | #define BA1_PDTC 0x0c0 /* BA1_PLAY_DMA_TRANSACTION_COUNT_REG */ | ||
| 1585 | #define BA1_PFIE 0x0c4 /* BA1_PLAY_FORMAT_&_INTERRUPT_ENABLE_REG */ | ||
| 1586 | #define BA1_PBA 0x0c8 /* BA1_PLAY_BUFFER_ADDRESS */ | ||
| 1587 | #define BA1_PVOL 0x0f8 /* BA1_PLAY_VOLUME_REG */ | ||
| 1588 | #define BA1_PSRC 0x288 /* BA1_PLAY_SAMPLE_RATE_CORRECTION_REG */ | ||
| 1589 | #define BA1_PCTL 0x2a4 /* BA1_PLAY_CONTROL_REG */ | ||
| 1590 | #define BA1_PPI 0x2b4 /* BA1_PLAY_PHASE_INCREMENT_REG */ | ||
| 1591 | |||
| 1592 | #define BA1_CCTL 0x064 /* BA1_CAPTURE_CONTROL_REG */ | ||
| 1593 | #define BA1_CIE 0x104 /* BA1_CAPTURE_INTERRUPT_ENABLE_REG */ | ||
| 1594 | #define BA1_CBA 0x10c /* BA1_CAPTURE_BUFFER_ADDRESS */ | ||
| 1595 | #define BA1_CSRC 0x2c8 /* BA1_CAPTURE_SAMPLE_RATE_CORRECTION_REG */ | ||
| 1596 | #define BA1_CCI 0x2d8 /* BA1_CAPTURE_COEFFICIENT_INCREMENT_REG */ | ||
| 1597 | #define BA1_CD 0x2e0 /* BA1_CAPTURE_DELAY_REG */ | ||
| 1598 | #define BA1_CPI 0x2f4 /* BA1_CAPTURE_PHASE_INCREMENT_REG */ | ||
| 1599 | #define BA1_CVOL 0x2f8 /* BA1_CAPTURE_VOLUME_REG */ | ||
| 1600 | |||
| 1601 | #define BA1_CFG1 0x134 /* BA1_CAPTURE_FRAME_GROUP_1_REG */ | ||
| 1602 | #define BA1_CFG2 0x138 /* BA1_CAPTURE_FRAME_GROUP_2_REG */ | ||
| 1603 | #define BA1_CCST 0x13c /* BA1_CAPTURE_CONSTANT_REG */ | ||
| 1604 | #define BA1_CSPB 0x340 /* BA1_CAPTURE_SPB_ADDRESS */ | ||
| 1605 | |||
| 1606 | /* | ||
| 1607 | * | ||
| 1608 | */ | ||
| 1609 | |||
| 1610 | #define CS46XX_MODE_OUTPUT (1<<0) /* MIDI UART - output */ | ||
| 1611 | #define CS46XX_MODE_INPUT (1<<1) /* MIDI UART - input */ | ||
| 1612 | |||
| 1613 | /* | ||
| 1614 | * | ||
| 1615 | */ | ||
| 1616 | |||
| 1617 | #define SAVE_REG_MAX 0x10 | ||
| 1618 | #define POWER_DOWN_ALL 0x7f0f | ||
| 1619 | |||
| 1620 | /* maxinum number of AC97 codecs connected, AC97 2.0 defined 4 */ | ||
| 1621 | #define MAX_NR_AC97 4 | ||
| 1622 | #define CS46XX_PRIMARY_CODEC_INDEX 0 | ||
| 1623 | #define CS46XX_SECONDARY_CODEC_INDEX 1 | ||
| 1624 | #define CS46XX_SECONDARY_CODEC_OFFSET 0x80 | ||
| 1625 | #define CS46XX_DSP_CAPTURE_CHANNEL 1 | ||
| 1626 | |||
| 1627 | /* capture */ | ||
| 1628 | #define CS46XX_DSP_CAPTURE_CHANNEL 1 | ||
| 1629 | |||
| 1630 | /* mixer */ | ||
| 1631 | #define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1 | ||
| 1632 | #define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2 | ||
| 1633 | |||
| 1634 | |||
| 1635 | struct snd_cs46xx_pcm { | ||
| 1636 | struct snd_dma_buffer hw_buf; | ||
| 1637 | |||
| 1638 | unsigned int ctl; | ||
| 1639 | unsigned int shift; /* Shift count to trasform frames in bytes */ | ||
| 1640 | struct snd_pcm_indirect pcm_rec; | ||
| 1641 | struct snd_pcm_substream *substream; | ||
| 1642 | |||
| 1643 | struct dsp_pcm_channel_descriptor * pcm_channel; | ||
| 1644 | |||
| 1645 | int pcm_channel_id; /* Fron Rear, Center Lfe ... */ | ||
| 1646 | }; | ||
| 1647 | |||
| 1648 | struct snd_cs46xx_region { | ||
| 1649 | char name[24]; | ||
| 1650 | unsigned long base; | ||
| 1651 | void __iomem *remap_addr; | ||
| 1652 | unsigned long size; | ||
| 1653 | struct resource *resource; | ||
| 1654 | }; | ||
| 1655 | |||
| 1656 | struct snd_cs46xx { | ||
| 1657 | int irq; | ||
| 1658 | unsigned long ba0_addr; | ||
| 1659 | unsigned long ba1_addr; | ||
| 1660 | union { | ||
| 1661 | struct { | ||
| 1662 | struct snd_cs46xx_region ba0; | ||
| 1663 | struct snd_cs46xx_region data0; | ||
| 1664 | struct snd_cs46xx_region data1; | ||
| 1665 | struct snd_cs46xx_region pmem; | ||
| 1666 | struct snd_cs46xx_region reg; | ||
| 1667 | } name; | ||
| 1668 | struct snd_cs46xx_region idx[5]; | ||
| 1669 | } region; | ||
| 1670 | |||
| 1671 | unsigned int mode; | ||
| 1672 | |||
| 1673 | struct { | ||
| 1674 | struct snd_dma_buffer hw_buf; | ||
| 1675 | |||
| 1676 | unsigned int ctl; | ||
| 1677 | unsigned int shift; /* Shift count to trasform frames in bytes */ | ||
| 1678 | struct snd_pcm_indirect pcm_rec; | ||
| 1679 | struct snd_pcm_substream *substream; | ||
| 1680 | } capt; | ||
| 1681 | |||
| 1682 | |||
| 1683 | int nr_ac97_codecs; | ||
| 1684 | struct snd_ac97_bus *ac97_bus; | ||
| 1685 | struct snd_ac97 *ac97[MAX_NR_AC97]; | ||
| 1686 | |||
| 1687 | struct pci_dev *pci; | ||
| 1688 | struct snd_card *card; | ||
| 1689 | struct snd_pcm *pcm; | ||
| 1690 | |||
| 1691 | struct snd_rawmidi *rmidi; | ||
| 1692 | struct snd_rawmidi_substream *midi_input; | ||
| 1693 | struct snd_rawmidi_substream *midi_output; | ||
| 1694 | |||
| 1695 | spinlock_t reg_lock; | ||
| 1696 | unsigned int midcr; | ||
| 1697 | unsigned int uartm; | ||
| 1698 | |||
| 1699 | int amplifier; | ||
| 1700 | void (*amplifier_ctrl)(struct snd_cs46xx *, int); | ||
| 1701 | void (*active_ctrl)(struct snd_cs46xx *, int); | ||
| 1702 | void (*mixer_init)(struct snd_cs46xx *); | ||
| 1703 | |||
| 1704 | int acpi_port; | ||
| 1705 | struct snd_kcontrol *eapd_switch; /* for amplifier hack */ | ||
| 1706 | int accept_valid; /* accept mmap valid (for OSS) */ | ||
| 1707 | int in_suspend; | ||
| 1708 | |||
| 1709 | struct gameport *gameport; | ||
| 1710 | |||
| 1711 | #ifdef CONFIG_SND_CS46XX_NEW_DSP | ||
| 1712 | struct mutex spos_mutex; | ||
| 1713 | |||
| 1714 | struct dsp_spos_instance * dsp_spos_instance; | ||
| 1715 | |||
| 1716 | struct snd_pcm *pcm_rear; | ||
| 1717 | struct snd_pcm *pcm_center_lfe; | ||
| 1718 | struct snd_pcm *pcm_iec958; | ||
| 1719 | #else /* for compatibility */ | ||
| 1720 | struct snd_cs46xx_pcm *playback_pcm; | ||
| 1721 | unsigned int play_ctl; | ||
| 1722 | #endif | ||
| 1723 | |||
| 1724 | #ifdef CONFIG_PM | ||
| 1725 | u32 *saved_regs; | ||
| 1726 | #endif | ||
| 1727 | }; | ||
| 1728 | |||
| 1729 | int snd_cs46xx_create(struct snd_card *card, | ||
| 1730 | struct pci_dev *pci, | ||
| 1731 | int external_amp, int thinkpad, | ||
| 1732 | struct snd_cs46xx **rcodec); | ||
| 1733 | int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state); | ||
| 1734 | int snd_cs46xx_resume(struct pci_dev *pci); | ||
| 1735 | |||
| 1736 | int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | ||
| 1737 | int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | ||
| 1738 | int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | ||
| 1739 | int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); | ||
| 1740 | int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device); | ||
| 1741 | int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi); | ||
| 1742 | int snd_cs46xx_start_dsp(struct snd_cs46xx *chip); | ||
| 1743 | int snd_cs46xx_gameport(struct snd_cs46xx *chip); | ||
| 1744 | |||
| 1745 | #endif /* __SOUND_CS46XX_H */ | ||
diff --git a/include/sound/cs46xx_dsp_scb_types.h b/include/sound/cs46xx_dsp_scb_types.h deleted file mode 100644 index 080857ad0ca2..000000000000 --- a/include/sound/cs46xx_dsp_scb_types.h +++ /dev/null | |||
| @@ -1,1213 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards | ||
| 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> | ||
| 4 | * | ||
| 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 | * NOTE: comments are copy/paste from cwcemb80.lst | ||
| 22 | * provided by Tom Woller at Cirrus (my only | ||
| 23 | * documentation about the SP OS running inside | ||
| 24 | * the DSP) | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __CS46XX_DSP_SCB_TYPES_H__ | ||
| 28 | #define __CS46XX_DSP_SCB_TYPES_H__ | ||
| 29 | |||
| 30 | #include <asm/byteorder.h> | ||
| 31 | |||
| 32 | #ifndef ___DSP_DUAL_16BIT_ALLOC | ||
| 33 | #if defined(__LITTLE_ENDIAN) | ||
| 34 | #define ___DSP_DUAL_16BIT_ALLOC(a,b) u16 a; u16 b; | ||
| 35 | #elif defined(__BIG_ENDIAN) | ||
| 36 | #define ___DSP_DUAL_16BIT_ALLOC(a,b) u16 b; u16 a; | ||
| 37 | #else | ||
| 38 | #error Not __LITTLE_ENDIAN and not __BIG_ENDIAN, then what ??? | ||
| 39 | #endif | ||
| 40 | #endif | ||
| 41 | |||
| 42 | /* This structs are used internally by the SP */ | ||
| 43 | |||
| 44 | struct dsp_basic_dma_req { | ||
| 45 | /* DMA Requestor Word 0 (DCW) fields: | ||
| 46 | |||
| 47 | 31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0] | ||
| 48 | _______________________________________________________________________________________ | ||
| 49 | |S| SBT |D| DBT |wb|wb| | | LS | SS |Opt|Do|SSG|DSG| | | | | | | Dword | | ||
| 50 | |H|_____ |H|_________|S_|D |__|__|______|_______|___|ne|__ |__ |__|__|_|_|_|_|_Count -1| | ||
| 51 | */ | ||
| 52 | u32 dcw; /* DMA Control Word */ | ||
| 53 | u32 dmw; /* DMA Mode Word */ | ||
| 54 | u32 saw; /* Source Address Word */ | ||
| 55 | u32 daw; /* Destination Address Word */ | ||
| 56 | }; | ||
| 57 | |||
| 58 | struct dsp_scatter_gather_ext { | ||
| 59 | u32 npaw; /* Next-Page Address Word */ | ||
| 60 | |||
| 61 | /* DMA Requestor Word 5 (NPCW) fields: | ||
| 62 | |||
| 63 | 31-30 29 28 [27:16] [15:12] [11:3] [2:0] | ||
| 64 | _________________________________________________________________________________________ | ||
| 65 | |SV |LE|SE| Sample-end byte offset | | Page-map entry offset for next | | | ||
| 66 | |page|__|__| ___________________________|_________|__page, if !sample-end___________|____| | ||
| 67 | */ | ||
| 68 | u32 npcw; /* Next-Page Control Word */ | ||
| 69 | u32 lbaw; /* Loop-Begin Address Word */ | ||
| 70 | u32 nplbaw; /* Next-Page after Loop-Begin Address Word */ | ||
| 71 | u32 sgaw; /* Scatter/Gather Address Word */ | ||
| 72 | }; | ||
| 73 | |||
| 74 | struct dsp_volume_control { | ||
| 75 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 76 | rightTarg, /* Target volume for left & right channels */ | ||
| 77 | leftTarg | ||
| 78 | ) | ||
| 79 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 80 | rightVol, /* Current left & right channel volumes */ | ||
| 81 | leftVol | ||
| 82 | ) | ||
| 83 | }; | ||
| 84 | |||
| 85 | /* Generic stream control block (SCB) structure definition */ | ||
| 86 | struct dsp_generic_scb { | ||
| 87 | /* For streaming I/O, the DSP should never alter any words in the DMA | ||
| 88 | requestor or the scatter/gather extension. Only ad hoc DMA request | ||
| 89 | streams are free to alter the requestor (currently only occur in the | ||
| 90 | DOS-based MIDI controller and in debugger-inserted code). | ||
| 91 | |||
| 92 | If an SCB does not have any associated DMA requestor, these 9 ints | ||
| 93 | may be freed for use by other tasks, but the pointer to the SCB must | ||
| 94 | still be such that the insOrd:nextSCB appear at offset 9 from the | ||
| 95 | SCB pointer. | ||
| 96 | |||
| 97 | Basic (non scatter/gather) DMA requestor (4 ints) | ||
| 98 | */ | ||
| 99 | |||
| 100 | /* Initialized by the host, only modified by DMA | ||
| 101 | R/O for the DSP task */ | ||
| 102 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 103 | |||
| 104 | /* Scatter/gather DMA requestor extension (5 ints) | ||
| 105 | Initialized by the host, only modified by DMA | ||
| 106 | DSP task never needs to even read these. | ||
| 107 | */ | ||
| 108 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 109 | |||
| 110 | /* Sublist pointer & next stream control block (SCB) link. | ||
| 111 | Initialized & modified by the host R/O for the DSP task | ||
| 112 | */ | ||
| 113 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 114 | next_scb, /* REQUIRED */ | ||
| 115 | sub_list_ptr /* REQUIRED */ | ||
| 116 | ) | ||
| 117 | |||
| 118 | /* Pointer to this tasks parameter block & stream function pointer | ||
| 119 | Initialized by the host R/O for the DSP task */ | ||
| 120 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 121 | entry_point, /* REQUIRED */ | ||
| 122 | this_spb /* REQUIRED */ | ||
| 123 | ) | ||
| 124 | |||
| 125 | /* rsConfig register for stream buffer (rsDMA reg. | ||
| 126 | is loaded from basicReq.daw for incoming streams, or | ||
| 127 | basicReq.saw, for outgoing streams) | ||
| 128 | |||
| 129 | 31 30 29 [28:24] [23:16] 15 14 13 12 11 10 9 8 7 6 5 4 [3:0] | ||
| 130 | ______________________________________________________________________________ | ||
| 131 | |DMA |D|maxDMAsize| streamNum|dir|p| | | | | | |ds |shr 1|rev Cy | mod | | ||
| 132 | |prio |_|__________|__________|___|_|__|__|__|__|_|_|___|_____|_______|_______| | ||
| 133 | 31 30 29 [28:24] [23:16] 15 14 13 12 11 10 9 8 7 6 5 4 [3:0] | ||
| 134 | |||
| 135 | |||
| 136 | Initialized by the host R/O for the DSP task | ||
| 137 | */ | ||
| 138 | u32 strm_rs_config; /* REQUIRED */ | ||
| 139 | // | ||
| 140 | /* On mixer input streams: indicates mixer input stream configuration | ||
| 141 | On Tees, this is copied from the stream being snooped | ||
| 142 | |||
| 143 | Stream sample pointer & MAC-unit mode for this stream | ||
| 144 | |||
| 145 | Initialized by the host Updated by the DSP task | ||
| 146 | */ | ||
| 147 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 148 | |||
| 149 | /* On mixer input streams: points to next mixer input and is updated by the | ||
| 150 | mixer subroutine in the "parent" DSP task | ||
| 151 | (least-significant 16 bits are preserved, unused) | ||
| 152 | |||
| 153 | On Tees, the pointer is copied from the stream being snooped on | ||
| 154 | initialization, and, subsequently, it is copied into the | ||
| 155 | stream being snooped. | ||
| 156 | |||
| 157 | On wavetable/3D voices: the strmBufPtr will use all 32 bits to allow for | ||
| 158 | fractional phase accumulation | ||
| 159 | |||
| 160 | Fractional increment per output sample in the input sample buffer | ||
| 161 | |||
| 162 | (Not used on mixer input streams & redefined on Tees) | ||
| 163 | On wavetable/3D voices: this 32-bit word specifies the integer.fractional | ||
| 164 | increment per output sample. | ||
| 165 | */ | ||
| 166 | u32 strmPhiIncr; | ||
| 167 | |||
| 168 | |||
| 169 | /* Standard stereo volume control | ||
| 170 | Initialized by the host (host updates target volumes) | ||
| 171 | |||
| 172 | Current volumes update by the DSP task | ||
| 173 | On mixer input streams: required & updated by the mixer subroutine in the | ||
| 174 | "parent" DSP task | ||
| 175 | |||
| 176 | On Tees, both current & target volumes are copied up on initialization, | ||
| 177 | and, subsequently, the target volume is copied up while the current | ||
| 178 | volume is copied down. | ||
| 179 | |||
| 180 | These two 32-bit words are redefined for wavetable & 3-D voices. | ||
| 181 | */ | ||
| 182 | struct dsp_volume_control vol_ctrl_t; /* Optional */ | ||
| 183 | }; | ||
| 184 | |||
| 185 | |||
| 186 | struct dsp_spos_control_block { | ||
| 187 | /* WARNING: Certain items in this structure are modified by the host | ||
| 188 | Any dword that can be modified by the host, must not be | ||
| 189 | modified by the SP as the host can only do atomic dword | ||
| 190 | writes, and to do otherwise, even a read modify write, | ||
| 191 | may lead to corrupted data on the SP. | ||
| 192 | |||
| 193 | This rule does not apply to one off boot time initialisation prior to starting the SP | ||
| 194 | */ | ||
| 195 | |||
| 196 | |||
| 197 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 198 | /* First element on the Hyper forground task tree */ | ||
| 199 | hfg_tree_root_ptr, /* HOST */ | ||
| 200 | /* First 3 dwords are written by the host and read-only on the DSP */ | ||
| 201 | hfg_stack_base /* HOST */ | ||
| 202 | ) | ||
| 203 | |||
| 204 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 205 | /* Point to this data structure to enable easy access */ | ||
| 206 | spos_cb_ptr, /* SP */ | ||
| 207 | prev_task_tree_ptr /* SP && HOST */ | ||
| 208 | ) | ||
| 209 | |||
| 210 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 211 | /* Currently Unused */ | ||
| 212 | xxinterval_timer_period, | ||
| 213 | /* Enable extension of SPOS data structure */ | ||
| 214 | HFGSPB_ptr | ||
| 215 | ) | ||
| 216 | |||
| 217 | |||
| 218 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 219 | xxnum_HFG_ticks_thisInterval, | ||
| 220 | /* Modified by the DSP */ | ||
| 221 | xxnum_tntervals | ||
| 222 | ) | ||
| 223 | |||
| 224 | |||
| 225 | /* Set by DSP upon encountering a trap (breakpoint) or a spurious | ||
| 226 | interrupt. The host must clear this dword after reading it | ||
| 227 | upon receiving spInt1. */ | ||
| 228 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 229 | spurious_int_flag, /* (Host & SP) Nature of the spurious interrupt */ | ||
| 230 | trap_flag /* (Host & SP) Nature of detected Trap */ | ||
| 231 | ) | ||
| 232 | |||
| 233 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 234 | unused2, | ||
| 235 | invalid_IP_flag /* (Host & SP ) Indicate detection of invalid instruction pointer */ | ||
| 236 | ) | ||
| 237 | |||
| 238 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 239 | /* pointer to forground task tree header for use in next task search */ | ||
| 240 | fg_task_tree_hdr_ptr, /* HOST */ | ||
| 241 | /* Data structure for controlling synchronous link update */ | ||
| 242 | hfg_sync_update_ptr /* HOST */ | ||
| 243 | ) | ||
| 244 | |||
| 245 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 246 | begin_foreground_FCNT, /* SP */ | ||
| 247 | /* Place holder for holding sleep timing */ | ||
| 248 | last_FCNT_before_sleep /* SP */ | ||
| 249 | ) | ||
| 250 | |||
| 251 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 252 | unused7, /* SP */ | ||
| 253 | next_task_treePtr /* SP */ | ||
| 254 | ) | ||
| 255 | |||
| 256 | u32 unused5; | ||
| 257 | |||
| 258 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 259 | active_flags, /* SP */ | ||
| 260 | /* State flags, used to assist control of execution of Hyper Forground */ | ||
| 261 | HFG_flags /* SP */ | ||
| 262 | ) | ||
| 263 | |||
| 264 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 265 | unused9, | ||
| 266 | unused8 | ||
| 267 | ) | ||
| 268 | |||
| 269 | /* Space for saving enough context so that we can set up enough | ||
| 270 | to save some more context. | ||
| 271 | */ | ||
| 272 | u32 rFE_save_for_invalid_IP; | ||
| 273 | u32 r32_save_for_spurious_int; | ||
| 274 | u32 r32_save_for_trap; | ||
| 275 | u32 r32_save_for_HFG; | ||
| 276 | }; | ||
| 277 | |||
| 278 | /* SPB for MIX_TO_OSTREAM algorithm family */ | ||
| 279 | struct dsp_mix2_ostream_spb | ||
| 280 | { | ||
| 281 | /* 16b.16b integer.frac approximation to the | ||
| 282 | number of 3 sample triplets to output each | ||
| 283 | frame. (approximation must be floor, to | ||
| 284 | insure that the fractional error is always | ||
| 285 | positive) | ||
| 286 | */ | ||
| 287 | u32 outTripletsPerFrame; | ||
| 288 | |||
| 289 | /* 16b.16b integer.frac accumulated number of | ||
| 290 | output triplets since the start of group | ||
| 291 | */ | ||
| 292 | u32 accumOutTriplets; | ||
| 293 | }; | ||
| 294 | |||
| 295 | /* SCB for Timing master algorithm */ | ||
| 296 | struct dsp_timing_master_scb { | ||
| 297 | /* First 12 dwords from generic_scb_t */ | ||
| 298 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 299 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 300 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 301 | next_scb, /* REQUIRED */ | ||
| 302 | sub_list_ptr /* REQUIRED */ | ||
| 303 | ) | ||
| 304 | |||
| 305 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 306 | entry_point, /* REQUIRED */ | ||
| 307 | this_spb /* REQUIRED */ | ||
| 308 | ) | ||
| 309 | |||
| 310 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 311 | /* Initial values are 0000:xxxx */ | ||
| 312 | reserved, | ||
| 313 | extra_sample_accum | ||
| 314 | ) | ||
| 315 | |||
| 316 | |||
| 317 | /* Initial values are xxxx:0000 | ||
| 318 | hi: Current CODEC output FIFO pointer | ||
| 319 | (0 to 0x0f) | ||
| 320 | lo: Flag indicating that the CODEC | ||
| 321 | FIFO is sync'd (host clears to | ||
| 322 | resynchronize the FIFO pointer | ||
| 323 | upon start/restart) | ||
| 324 | */ | ||
| 325 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 326 | codec_FIFO_syncd, | ||
| 327 | codec_FIFO_ptr | ||
| 328 | ) | ||
| 329 | |||
| 330 | /* Init. 8000:0005 for 44.1k | ||
| 331 | 8000:0001 for 48k | ||
| 332 | hi: Fractional sample accumulator 0.16b | ||
| 333 | lo: Number of frames remaining to be | ||
| 334 | processed in the current group of | ||
| 335 | frames | ||
| 336 | */ | ||
| 337 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 338 | frac_samp_accum_qm1, | ||
| 339 | TM_frms_left_in_group | ||
| 340 | ) | ||
| 341 | |||
| 342 | /* Init. 0001:0005 for 44.1k | ||
| 343 | 0000:0001 for 48k | ||
| 344 | hi: Fractional sample correction factor 0.16b | ||
| 345 | to be added every frameGroupLength frames | ||
| 346 | to correct for truncation error in | ||
| 347 | nsamp_per_frm_q15 | ||
| 348 | lo: Number of frames in the group | ||
| 349 | */ | ||
| 350 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 351 | frac_samp_correction_qm1, | ||
| 352 | TM_frm_group_length | ||
| 353 | ) | ||
| 354 | |||
| 355 | /* Init. 44.1k*65536/8k = 0x00058333 for 44.1k | ||
| 356 | 48k*65536/8k = 0x00060000 for 48k | ||
| 357 | 16b.16b integer.frac approximation to the | ||
| 358 | number of samples to output each frame. | ||
| 359 | (approximation must be floor, to insure */ | ||
| 360 | u32 nsamp_per_frm_q15; | ||
| 361 | }; | ||
| 362 | |||
| 363 | /* SCB for CODEC output algorithm */ | ||
| 364 | struct dsp_codec_output_scb { | ||
| 365 | /* First 13 dwords from generic_scb_t */ | ||
| 366 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 367 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 368 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 369 | next_scb, /* REQUIRED */ | ||
| 370 | sub_list_ptr /* REQUIRED */ | ||
| 371 | ) | ||
| 372 | |||
| 373 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 374 | entry_point, /* REQUIRED */ | ||
| 375 | this_spb /* REQUIRED */ | ||
| 376 | ) | ||
| 377 | |||
| 378 | u32 strm_rs_config; /* REQUIRED */ | ||
| 379 | |||
| 380 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 381 | |||
| 382 | /* NOTE: The CODEC output task reads samples from the first task on its | ||
| 383 | sublist at the stream buffer pointer (init. to lag DMA destination | ||
| 384 | address word). After the required number of samples is transferred, | ||
| 385 | the CODEC output task advances sub_list_ptr->strm_buf_ptr past the samples | ||
| 386 | consumed. | ||
| 387 | */ | ||
| 388 | |||
| 389 | /* Init. 0000:0010 for SDout | ||
| 390 | 0060:0010 for SDout2 | ||
| 391 | 0080:0010 for SDout3 | ||
| 392 | hi: Base IO address of FIFO to which | ||
| 393 | the left-channel samples are to | ||
| 394 | be written. | ||
| 395 | lo: Displacement for the base IO | ||
| 396 | address for left-channel to obtain | ||
| 397 | the base IO address for the FIFO | ||
| 398 | to which the right-channel samples | ||
| 399 | are to be written. | ||
| 400 | */ | ||
| 401 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 402 | left_chan_base_IO_addr, | ||
| 403 | right_chan_IO_disp | ||
| 404 | ) | ||
| 405 | |||
| 406 | |||
| 407 | /* Init: 0x0080:0004 for non-AC-97 | ||
| 408 | Init: 0x0080:0000 for AC-97 | ||
| 409 | hi: Exponential volume change rate | ||
| 410 | for input stream | ||
| 411 | lo: Positive shift count to shift the | ||
| 412 | 16-bit input sample to obtain the | ||
| 413 | 32-bit output word | ||
| 414 | */ | ||
| 415 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 416 | CO_scale_shift_count, | ||
| 417 | CO_exp_vol_change_rate | ||
| 418 | ) | ||
| 419 | |||
| 420 | /* Pointer to SCB at end of input chain */ | ||
| 421 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 422 | reserved, | ||
| 423 | last_sub_ptr | ||
| 424 | ) | ||
| 425 | }; | ||
| 426 | |||
| 427 | /* SCB for CODEC input algorithm */ | ||
| 428 | struct dsp_codec_input_scb { | ||
| 429 | /* First 13 dwords from generic_scb_t */ | ||
| 430 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 431 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 432 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 433 | next_scb, /* REQUIRED */ | ||
| 434 | sub_list_ptr /* REQUIRED */ | ||
| 435 | ) | ||
| 436 | |||
| 437 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 438 | entry_point, /* REQUIRED */ | ||
| 439 | this_spb /* REQUIRED */ | ||
| 440 | ) | ||
| 441 | |||
| 442 | u32 strm_rs_config; /* REQUIRED */ | ||
| 443 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 444 | |||
| 445 | /* NOTE: The CODEC input task reads samples from the hardware FIFO | ||
| 446 | sublist at the DMA source address word (sub_list_ptr->basic_req.saw). | ||
| 447 | After the required number of samples is transferred, the CODEC | ||
| 448 | output task advances sub_list_ptr->basic_req.saw past the samples | ||
| 449 | consumed. SPuD must initialize the sub_list_ptr->basic_req.saw | ||
| 450 | to point half-way around from the initial sub_list_ptr->strm_nuf_ptr | ||
| 451 | to allow for lag/lead. | ||
| 452 | */ | ||
| 453 | |||
| 454 | /* Init. 0000:0010 for SDout | ||
| 455 | 0060:0010 for SDout2 | ||
| 456 | 0080:0010 for SDout3 | ||
| 457 | hi: Base IO address of FIFO to which | ||
| 458 | the left-channel samples are to | ||
| 459 | be written. | ||
| 460 | lo: Displacement for the base IO | ||
| 461 | address for left-channel to obtain | ||
| 462 | the base IO address for the FIFO | ||
| 463 | to which the right-channel samples | ||
| 464 | are to be written. | ||
| 465 | */ | ||
| 466 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 467 | rightChanINdisp, | ||
| 468 | left_chan_base_IN_addr | ||
| 469 | ) | ||
| 470 | /* Init. ?:fffc | ||
| 471 | lo: Negative shift count to shift the | ||
| 472 | 32-bit input dword to obtain the | ||
| 473 | 16-bit sample msb-aligned (count | ||
| 474 | is negative to shift left) | ||
| 475 | */ | ||
| 476 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 477 | scaleShiftCount, | ||
| 478 | reserver1 | ||
| 479 | ) | ||
| 480 | |||
| 481 | u32 reserved2; | ||
| 482 | }; | ||
| 483 | |||
| 484 | |||
| 485 | struct dsp_pcm_serial_input_scb { | ||
| 486 | /* First 13 dwords from generic_scb_t */ | ||
| 487 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 488 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 489 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 490 | next_scb, /* REQUIRED */ | ||
| 491 | sub_list_ptr /* REQUIRED */ | ||
| 492 | ) | ||
| 493 | |||
| 494 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 495 | entry_point, /* REQUIRED */ | ||
| 496 | this_spb /* REQUIRED */ | ||
| 497 | ) | ||
| 498 | |||
| 499 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 500 | u32 strm_rs_config; /* REQUIRED */ | ||
| 501 | |||
| 502 | /* Init. Ptr to CODEC input SCB | ||
| 503 | hi: Pointer to the SCB containing the | ||
| 504 | input buffer to which CODEC input | ||
| 505 | samples are written | ||
| 506 | lo: Flag indicating the link to the CODEC | ||
| 507 | input task is to be initialized | ||
| 508 | */ | ||
| 509 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 510 | init_codec_input_link, | ||
| 511 | codec_input_buf_scb | ||
| 512 | ) | ||
| 513 | |||
| 514 | /* Initialized by the host (host updates target volumes) */ | ||
| 515 | struct dsp_volume_control psi_vol_ctrl; | ||
| 516 | |||
| 517 | }; | ||
| 518 | |||
| 519 | struct dsp_src_task_scb { | ||
| 520 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 521 | frames_left_in_gof, | ||
| 522 | gofs_left_in_sec | ||
| 523 | ) | ||
| 524 | |||
| 525 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 526 | const2_thirds, | ||
| 527 | num_extra_tnput_samples | ||
| 528 | ) | ||
| 529 | |||
| 530 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 531 | cor_per_gof, | ||
| 532 | correction_per_sec | ||
| 533 | ) | ||
| 534 | |||
| 535 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 536 | output_buf_producer_ptr, | ||
| 537 | junk_DMA_MID | ||
| 538 | ) | ||
| 539 | |||
| 540 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 541 | gof_length, | ||
| 542 | gofs_per_sec | ||
| 543 | ) | ||
| 544 | |||
| 545 | u32 input_buf_strm_config; | ||
| 546 | |||
| 547 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 548 | reserved_for_SRC_use, | ||
| 549 | input_buf_consumer_ptr | ||
| 550 | ) | ||
| 551 | |||
| 552 | u32 accum_phi; | ||
| 553 | |||
| 554 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 555 | exp_src_vol_change_rate, | ||
| 556 | input_buf_producer_ptr | ||
| 557 | ) | ||
| 558 | |||
| 559 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 560 | src_next_scb, | ||
| 561 | src_sub_list_ptr | ||
| 562 | ) | ||
| 563 | |||
| 564 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 565 | src_entry_point, | ||
| 566 | src_this_sbp | ||
| 567 | ) | ||
| 568 | |||
| 569 | u32 src_strm_rs_config; | ||
| 570 | u32 src_strm_buf_ptr; | ||
| 571 | |||
| 572 | u32 phiIncr6int_26frac; | ||
| 573 | |||
| 574 | struct dsp_volume_control src_vol_ctrl; | ||
| 575 | }; | ||
| 576 | |||
| 577 | struct dsp_decimate_by_pow2_scb { | ||
| 578 | /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory | ||
| 579 | when compared to cascading decimators) | ||
| 580 | */ | ||
| 581 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 582 | dec2_coef_base_ptr, | ||
| 583 | dec2_coef_increment | ||
| 584 | ) | ||
| 585 | |||
| 586 | /* coefIncrement = 128 / decimationFactor (for our ROM filter) | ||
| 587 | coefBasePtr = 0x8000 (for our ROM filter) | ||
| 588 | */ | ||
| 589 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 590 | dec2_in_samples_per_out_triplet, | ||
| 591 | dec2_extra_in_samples | ||
| 592 | ) | ||
| 593 | /* extraInSamples: # of accumulated, unused input samples (init. to 0) | ||
| 594 | inSamplesPerOutTriplet = 3 * decimationFactor | ||
| 595 | */ | ||
| 596 | |||
| 597 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 598 | dec2_const2_thirds, | ||
| 599 | dec2_half_num_taps_mp5 | ||
| 600 | ) | ||
| 601 | /* halfNumTapsM5: (1/2 number of taps in decimation filter) minus 5 | ||
| 602 | const2thirds: constant 2/3 in 16Q0 format (sign.15) | ||
| 603 | */ | ||
| 604 | |||
| 605 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 606 | dec2_output_buf_producer_ptr, | ||
| 607 | dec2_junkdma_mid | ||
| 608 | ) | ||
| 609 | |||
| 610 | u32 dec2_reserved2; | ||
| 611 | |||
| 612 | u32 dec2_input_nuf_strm_config; | ||
| 613 | /* inputBufStrmConfig: rsConfig for the input buffer to the decimator | ||
| 614 | (buffer size = decimationFactor * 32 dwords) | ||
| 615 | */ | ||
| 616 | |||
| 617 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 618 | dec2_phi_incr, | ||
| 619 | dec2_input_buf_consumer_ptr | ||
| 620 | ) | ||
| 621 | /* inputBufConsumerPtr: Input buffer read pointer (into SRC filter) | ||
| 622 | phiIncr = decimationFactor * 4 | ||
| 623 | */ | ||
| 624 | |||
| 625 | u32 dec2_reserved3; | ||
| 626 | |||
| 627 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 628 | dec2_exp_vol_change_rate, | ||
| 629 | dec2_input_buf_producer_ptr | ||
| 630 | ) | ||
| 631 | /* inputBufProducerPtr: Input buffer write pointer | ||
| 632 | expVolChangeRate: Exponential volume change rate for possible | ||
| 633 | future mixer on input streams | ||
| 634 | */ | ||
| 635 | |||
| 636 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 637 | dec2_next_scb, | ||
| 638 | dec2_sub_list_ptr | ||
| 639 | ) | ||
| 640 | |||
| 641 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 642 | dec2_entry_point, | ||
| 643 | dec2_this_spb | ||
| 644 | ) | ||
| 645 | |||
| 646 | u32 dec2_strm_rs_config; | ||
| 647 | u32 dec2_strm_buf_ptr; | ||
| 648 | |||
| 649 | u32 dec2_reserved4; | ||
| 650 | |||
| 651 | struct dsp_volume_control dec2_vol_ctrl; /* Not used! */ | ||
| 652 | }; | ||
| 653 | |||
| 654 | struct dsp_vari_decimate_scb { | ||
| 655 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 656 | vdec_frames_left_in_gof, | ||
| 657 | vdec_gofs_left_in_sec | ||
| 658 | ) | ||
| 659 | |||
| 660 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 661 | vdec_const2_thirds, | ||
| 662 | vdec_extra_in_samples | ||
| 663 | ) | ||
| 664 | /* extraInSamples: # of accumulated, unused input samples (init. to 0) | ||
| 665 | const2thirds: constant 2/3 in 16Q0 format (sign.15) */ | ||
| 666 | |||
| 667 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 668 | vdec_cor_per_gof, | ||
| 669 | vdec_correction_per_sec | ||
| 670 | ) | ||
| 671 | |||
| 672 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 673 | vdec_output_buf_producer_ptr, | ||
| 674 | vdec_input_buf_consumer_ptr | ||
| 675 | ) | ||
| 676 | /* inputBufConsumerPtr: Input buffer read pointer (into SRC filter) */ | ||
| 677 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 678 | vdec_gof_length, | ||
| 679 | vdec_gofs_per_sec | ||
| 680 | ) | ||
| 681 | |||
| 682 | u32 vdec_input_buf_strm_config; | ||
| 683 | /* inputBufStrmConfig: rsConfig for the input buffer to the decimator | ||
| 684 | (buffer size = 64 dwords) */ | ||
| 685 | u32 vdec_coef_increment; | ||
| 686 | /* coefIncrement = - 128.0 / decimationFactor (as a 32Q15 number) */ | ||
| 687 | |||
| 688 | u32 vdec_accumphi; | ||
| 689 | /* accumPhi: accumulated fractional phase increment (6.26) */ | ||
| 690 | |||
| 691 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 692 | vdec_exp_vol_change_rate, | ||
| 693 | vdec_input_buf_producer_ptr | ||
| 694 | ) | ||
| 695 | /* inputBufProducerPtr: Input buffer write pointer | ||
| 696 | expVolChangeRate: Exponential volume change rate for possible | ||
| 697 | future mixer on input streams */ | ||
| 698 | |||
| 699 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 700 | vdec_next_scb, | ||
| 701 | vdec_sub_list_ptr | ||
| 702 | ) | ||
| 703 | |||
| 704 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 705 | vdec_entry_point, | ||
| 706 | vdec_this_spb | ||
| 707 | ) | ||
| 708 | |||
| 709 | u32 vdec_strm_rs_config; | ||
| 710 | u32 vdec_strm_buf_ptr; | ||
| 711 | |||
| 712 | u32 vdec_phi_incr_6int_26frac; | ||
| 713 | |||
| 714 | struct dsp_volume_control vdec_vol_ctrl; | ||
| 715 | }; | ||
| 716 | |||
| 717 | |||
| 718 | /* SCB for MIX_TO_OSTREAM algorithm family */ | ||
| 719 | struct dsp_mix2_ostream_scb { | ||
| 720 | /* First 13 dwords from generic_scb_t */ | ||
| 721 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 722 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 723 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 724 | next_scb, /* REQUIRED */ | ||
| 725 | sub_list_ptr /* REQUIRED */ | ||
| 726 | ) | ||
| 727 | |||
| 728 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 729 | entry_point, /* REQUIRED */ | ||
| 730 | this_spb /* REQUIRED */ | ||
| 731 | ) | ||
| 732 | |||
| 733 | u32 strm_rs_config; /* REQUIRED */ | ||
| 734 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 735 | |||
| 736 | |||
| 737 | /* hi: Number of mixed-down input triplets | ||
| 738 | computed since start of group | ||
| 739 | lo: Number of frames remaining to be | ||
| 740 | processed in the current group of | ||
| 741 | frames | ||
| 742 | */ | ||
| 743 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 744 | frames_left_in_group, | ||
| 745 | accum_input_triplets | ||
| 746 | ) | ||
| 747 | |||
| 748 | /* hi: Exponential volume change rate | ||
| 749 | for mixer on input streams | ||
| 750 | lo: Number of frames in the group | ||
| 751 | */ | ||
| 752 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 753 | frame_group_length, | ||
| 754 | exp_vol_change_rate | ||
| 755 | ) | ||
| 756 | |||
| 757 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 758 | const_FFFF, | ||
| 759 | const_zero | ||
| 760 | ) | ||
| 761 | }; | ||
| 762 | |||
| 763 | |||
| 764 | /* SCB for S16_MIX algorithm */ | ||
| 765 | struct dsp_mix_only_scb { | ||
| 766 | /* First 13 dwords from generic_scb_t */ | ||
| 767 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 768 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 769 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 770 | next_scb, /* REQUIRED */ | ||
| 771 | sub_list_ptr /* REQUIRED */ | ||
| 772 | ) | ||
| 773 | |||
| 774 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 775 | entry_point, /* REQUIRED */ | ||
| 776 | this_spb /* REQUIRED */ | ||
| 777 | ) | ||
| 778 | |||
| 779 | u32 strm_rs_config; /* REQUIRED */ | ||
| 780 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 781 | |||
| 782 | u32 reserved; | ||
| 783 | struct dsp_volume_control vol_ctrl; | ||
| 784 | }; | ||
| 785 | |||
| 786 | /* SCB for the async. CODEC input algorithm */ | ||
| 787 | struct dsp_async_codec_input_scb { | ||
| 788 | u32 io_free2; | ||
| 789 | |||
| 790 | u32 io_current_total; | ||
| 791 | u32 io_previous_total; | ||
| 792 | |||
| 793 | u16 io_count; | ||
| 794 | u16 io_count_limit; | ||
| 795 | |||
| 796 | u16 o_fifo_base_addr; | ||
| 797 | u16 ost_mo_format; | ||
| 798 | /* 1 = stereo; 0 = mono | ||
| 799 | xxx for ASER 1 (not allowed); 118 for ASER2 */ | ||
| 800 | |||
| 801 | u32 ostrm_rs_config; | ||
| 802 | u32 ostrm_buf_ptr; | ||
| 803 | |||
| 804 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 805 | io_sclks_per_lr_clk, | ||
| 806 | io_io_enable | ||
| 807 | ) | ||
| 808 | |||
| 809 | u32 io_free4; | ||
| 810 | |||
| 811 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 812 | io_next_scb, | ||
| 813 | io_sub_list_ptr | ||
| 814 | ) | ||
| 815 | |||
| 816 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 817 | io_entry_point, | ||
| 818 | io_this_spb | ||
| 819 | ) | ||
| 820 | |||
| 821 | u32 istrm_rs_config; | ||
| 822 | u32 istrm_buf_ptr; | ||
| 823 | |||
| 824 | /* Init. 0000:8042: for ASER1 | ||
| 825 | 0000:8044: for ASER2 */ | ||
| 826 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 827 | io_stat_reg_addr, | ||
| 828 | iofifo_pointer | ||
| 829 | ) | ||
| 830 | |||
| 831 | /* Init 1 stero:100 ASER1 | ||
| 832 | Init 0 mono:110 ASER2 | ||
| 833 | */ | ||
| 834 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 835 | ififo_base_addr, | ||
| 836 | ist_mo_format | ||
| 837 | ) | ||
| 838 | |||
| 839 | u32 i_free; | ||
| 840 | }; | ||
| 841 | |||
| 842 | |||
| 843 | /* SCB for the SP/DIF CODEC input and output */ | ||
| 844 | struct dsp_spdifiscb { | ||
| 845 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 846 | status_ptr, | ||
| 847 | status_start_ptr | ||
| 848 | ) | ||
| 849 | |||
| 850 | u32 current_total; | ||
| 851 | u32 previous_total; | ||
| 852 | |||
| 853 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 854 | count, | ||
| 855 | count_limit | ||
| 856 | ) | ||
| 857 | |||
| 858 | u32 status_data; | ||
| 859 | |||
| 860 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 861 | status, | ||
| 862 | free4 | ||
| 863 | ) | ||
| 864 | |||
| 865 | u32 free3; | ||
| 866 | |||
| 867 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 868 | free2, | ||
| 869 | bit_count | ||
| 870 | ) | ||
| 871 | |||
| 872 | u32 temp_status; | ||
| 873 | |||
| 874 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 875 | next_SCB, | ||
| 876 | sub_list_ptr | ||
| 877 | ) | ||
| 878 | |||
| 879 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 880 | entry_point, | ||
| 881 | this_spb | ||
| 882 | ) | ||
| 883 | |||
| 884 | u32 strm_rs_config; | ||
| 885 | u32 strm_buf_ptr; | ||
| 886 | |||
| 887 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 888 | stat_reg_addr, | ||
| 889 | fifo_pointer | ||
| 890 | ) | ||
| 891 | |||
| 892 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 893 | fifo_base_addr, | ||
| 894 | st_mo_format | ||
| 895 | ) | ||
| 896 | |||
| 897 | u32 free1; | ||
| 898 | }; | ||
| 899 | |||
| 900 | |||
| 901 | /* SCB for the SP/DIF CODEC input and output */ | ||
| 902 | struct dsp_spdifoscb { | ||
| 903 | |||
| 904 | u32 free2; | ||
| 905 | |||
| 906 | u32 free3[4]; | ||
| 907 | |||
| 908 | /* Need to be here for compatibility with AsynchFGTxCode */ | ||
| 909 | u32 strm_rs_config; | ||
| 910 | |||
| 911 | u32 strm_buf_ptr; | ||
| 912 | |||
| 913 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 914 | status, | ||
| 915 | free5 | ||
| 916 | ) | ||
| 917 | |||
| 918 | u32 free4; | ||
| 919 | |||
| 920 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 921 | next_scb, | ||
| 922 | sub_list_ptr | ||
| 923 | ) | ||
| 924 | |||
| 925 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 926 | entry_point, | ||
| 927 | this_spb | ||
| 928 | ) | ||
| 929 | |||
| 930 | u32 free6[2]; | ||
| 931 | |||
| 932 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 933 | stat_reg_addr, | ||
| 934 | fifo_pointer | ||
| 935 | ) | ||
| 936 | |||
| 937 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 938 | fifo_base_addr, | ||
| 939 | st_mo_format | ||
| 940 | ) | ||
| 941 | |||
| 942 | u32 free1; | ||
| 943 | }; | ||
| 944 | |||
| 945 | |||
| 946 | struct dsp_asynch_fg_rx_scb { | ||
| 947 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 948 | bot_buf_mask, | ||
| 949 | buf_Mask | ||
| 950 | ) | ||
| 951 | |||
| 952 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 953 | max, | ||
| 954 | min | ||
| 955 | ) | ||
| 956 | |||
| 957 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 958 | old_producer_pointer, | ||
| 959 | hfg_scb_ptr | ||
| 960 | ) | ||
| 961 | |||
| 962 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 963 | delta, | ||
| 964 | adjust_count | ||
| 965 | ) | ||
| 966 | |||
| 967 | u32 unused2[5]; | ||
| 968 | |||
| 969 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 970 | sibling_ptr, | ||
| 971 | child_ptr | ||
| 972 | ) | ||
| 973 | |||
| 974 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 975 | code_ptr, | ||
| 976 | this_ptr | ||
| 977 | ) | ||
| 978 | |||
| 979 | u32 strm_rs_config; | ||
| 980 | |||
| 981 | u32 strm_buf_ptr; | ||
| 982 | |||
| 983 | u32 unused_phi_incr; | ||
| 984 | |||
| 985 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 986 | right_targ, | ||
| 987 | left_targ | ||
| 988 | ) | ||
| 989 | |||
| 990 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 991 | right_vol, | ||
| 992 | left_vol | ||
| 993 | ) | ||
| 994 | }; | ||
| 995 | |||
| 996 | |||
| 997 | struct dsp_asynch_fg_tx_scb { | ||
| 998 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 999 | not_buf_mask, | ||
| 1000 | buf_mask | ||
| 1001 | ) | ||
| 1002 | |||
| 1003 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1004 | max, | ||
| 1005 | min | ||
| 1006 | ) | ||
| 1007 | |||
| 1008 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1009 | unused1, | ||
| 1010 | hfg_scb_ptr | ||
| 1011 | ) | ||
| 1012 | |||
| 1013 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1014 | delta, | ||
| 1015 | adjust_count | ||
| 1016 | ) | ||
| 1017 | |||
| 1018 | u32 accum_phi; | ||
| 1019 | |||
| 1020 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1021 | unused2, | ||
| 1022 | const_one_third | ||
| 1023 | ) | ||
| 1024 | |||
| 1025 | u32 unused3[3]; | ||
| 1026 | |||
| 1027 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1028 | sibling_ptr, | ||
| 1029 | child_ptr | ||
| 1030 | ) | ||
| 1031 | |||
| 1032 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1033 | codePtr, | ||
| 1034 | this_ptr | ||
| 1035 | ) | ||
| 1036 | |||
| 1037 | u32 strm_rs_config; | ||
| 1038 | |||
| 1039 | u32 strm_buf_ptr; | ||
| 1040 | |||
| 1041 | u32 phi_incr; | ||
| 1042 | |||
| 1043 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1044 | unused_right_targ, | ||
| 1045 | unused_left_targ | ||
| 1046 | ) | ||
| 1047 | |||
| 1048 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1049 | unused_right_vol, | ||
| 1050 | unused_left_vol | ||
| 1051 | ) | ||
| 1052 | }; | ||
| 1053 | |||
| 1054 | |||
| 1055 | struct dsp_output_snoop_scb { | ||
| 1056 | /* First 13 dwords from generic_scb_t */ | ||
| 1057 | struct dsp_basic_dma_req basic_req; /* Optional */ | ||
| 1058 | struct dsp_scatter_gather_ext sg_ext; /* Optional */ | ||
| 1059 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1060 | next_scb, /* REQUIRED */ | ||
| 1061 | sub_list_ptr /* REQUIRED */ | ||
| 1062 | ) | ||
| 1063 | |||
| 1064 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1065 | entry_point, /* REQUIRED */ | ||
| 1066 | this_spb /* REQUIRED */ | ||
| 1067 | ) | ||
| 1068 | |||
| 1069 | u32 strm_rs_config; /* REQUIRED */ | ||
| 1070 | u32 strm_buf_ptr; /* REQUIRED */ | ||
| 1071 | |||
| 1072 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1073 | init_snoop_input_link, | ||
| 1074 | snoop_child_input_scb | ||
| 1075 | ) | ||
| 1076 | |||
| 1077 | u32 snoop_input_buf_ptr; | ||
| 1078 | |||
| 1079 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1080 | reserved, | ||
| 1081 | input_scb | ||
| 1082 | ) | ||
| 1083 | }; | ||
| 1084 | |||
| 1085 | struct dsp_spio_write_scb { | ||
| 1086 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1087 | address1, | ||
| 1088 | address2 | ||
| 1089 | ) | ||
| 1090 | |||
| 1091 | u32 data1; | ||
| 1092 | |||
| 1093 | u32 data2; | ||
| 1094 | |||
| 1095 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1096 | address3, | ||
| 1097 | address4 | ||
| 1098 | ) | ||
| 1099 | |||
| 1100 | u32 data3; | ||
| 1101 | |||
| 1102 | u32 data4; | ||
| 1103 | |||
| 1104 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1105 | unused1, | ||
| 1106 | data_ptr | ||
| 1107 | ) | ||
| 1108 | |||
| 1109 | u32 unused2[2]; | ||
| 1110 | |||
| 1111 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1112 | sibling_ptr, | ||
| 1113 | child_ptr | ||
| 1114 | ) | ||
| 1115 | |||
| 1116 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1117 | entry_point, | ||
| 1118 | this_ptr | ||
| 1119 | ) | ||
| 1120 | |||
| 1121 | u32 unused3[5]; | ||
| 1122 | }; | ||
| 1123 | |||
| 1124 | struct dsp_magic_snoop_task { | ||
| 1125 | u32 i0; | ||
| 1126 | u32 i1; | ||
| 1127 | |||
| 1128 | u32 strm_buf_ptr1; | ||
| 1129 | |||
| 1130 | u16 i2; | ||
| 1131 | u16 snoop_scb; | ||
| 1132 | |||
| 1133 | u32 i3; | ||
| 1134 | u32 i4; | ||
| 1135 | u32 i5; | ||
| 1136 | u32 i6; | ||
| 1137 | |||
| 1138 | u32 i7; | ||
| 1139 | |||
| 1140 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1141 | next_scb, | ||
| 1142 | sub_list_ptr | ||
| 1143 | ) | ||
| 1144 | |||
| 1145 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1146 | entry_point, | ||
| 1147 | this_ptr | ||
| 1148 | ) | ||
| 1149 | |||
| 1150 | u32 strm_buf_config; | ||
| 1151 | u32 strm_buf_ptr2; | ||
| 1152 | |||
| 1153 | u32 i8; | ||
| 1154 | |||
| 1155 | struct dsp_volume_control vdec_vol_ctrl; | ||
| 1156 | }; | ||
| 1157 | |||
| 1158 | |||
| 1159 | struct dsp_filter_scb { | ||
| 1160 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1161 | a0_right, /* 0x00 */ | ||
| 1162 | a0_left | ||
| 1163 | ) | ||
| 1164 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1165 | a1_right, /* 0x01 */ | ||
| 1166 | a1_left | ||
| 1167 | ) | ||
| 1168 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1169 | a2_right, /* 0x02 */ | ||
| 1170 | a2_left | ||
| 1171 | ) | ||
| 1172 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1173 | output_buf_ptr, /* 0x03 */ | ||
| 1174 | init | ||
| 1175 | ) | ||
| 1176 | |||
| 1177 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1178 | filter_unused3, /* 0x04 */ | ||
| 1179 | filter_unused2 | ||
| 1180 | ) | ||
| 1181 | |||
| 1182 | u32 prev_sample_output1; /* 0x05 */ | ||
| 1183 | u32 prev_sample_output2; /* 0x06 */ | ||
| 1184 | u32 prev_sample_input1; /* 0x07 */ | ||
| 1185 | u32 prev_sample_input2; /* 0x08 */ | ||
| 1186 | |||
| 1187 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1188 | next_scb_ptr, /* 0x09 */ | ||
| 1189 | sub_list_ptr | ||
| 1190 | ) | ||
| 1191 | |||
| 1192 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1193 | entry_point, /* 0x0A */ | ||
| 1194 | spb_ptr | ||
| 1195 | ) | ||
| 1196 | |||
| 1197 | u32 strm_rs_config; /* 0x0B */ | ||
| 1198 | u32 strm_buf_ptr; /* 0x0C */ | ||
| 1199 | |||
| 1200 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1201 | b0_right, /* 0x0D */ | ||
| 1202 | b0_left | ||
| 1203 | ) | ||
| 1204 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1205 | b1_right, /* 0x0E */ | ||
| 1206 | b1_left | ||
| 1207 | ) | ||
| 1208 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 1209 | b2_right, /* 0x0F */ | ||
| 1210 | b2_left | ||
| 1211 | ) | ||
| 1212 | }; | ||
| 1213 | #endif /* __DSP_SCB_TYPES_H__ */ | ||
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h deleted file mode 100644 index 8008c59288a6..000000000000 --- a/include/sound/cs46xx_dsp_spos.h +++ /dev/null | |||
| @@ -1,234 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards | ||
| 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> | ||
| 4 | * | ||
| 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 | |||
| 22 | #ifndef __CS46XX_DSP_SPOS_H__ | ||
| 23 | #define __CS46XX_DSP_SPOS_H__ | ||
| 24 | |||
| 25 | #include "cs46xx_dsp_scb_types.h" | ||
| 26 | #include "cs46xx_dsp_task_types.h" | ||
| 27 | |||
| 28 | #define SYMBOL_CONSTANT 0x0 | ||
| 29 | #define SYMBOL_SAMPLE 0x1 | ||
| 30 | #define SYMBOL_PARAMETER 0x2 | ||
| 31 | #define SYMBOL_CODE 0x3 | ||
| 32 | |||
| 33 | #define SEGTYPE_SP_PROGRAM 0x00000001 | ||
| 34 | #define SEGTYPE_SP_PARAMETER 0x00000002 | ||
| 35 | #define SEGTYPE_SP_SAMPLE 0x00000003 | ||
| 36 | #define SEGTYPE_SP_COEFFICIENT 0x00000004 | ||
| 37 | |||
| 38 | #define DSP_SPOS_UU 0x0deadul /* unused */ | ||
| 39 | #define DSP_SPOS_DC 0x0badul /* don't care */ | ||
| 40 | #define DSP_SPOS_DC_DC 0x0bad0badul /* don't care */ | ||
| 41 | #define DSP_SPOS_UUUU 0xdeadc0edul /* unused */ | ||
| 42 | #define DSP_SPOS_UUHI 0xdeadul | ||
| 43 | #define DSP_SPOS_UULO 0xc0edul | ||
| 44 | #define DSP_SPOS_DCDC 0x0badf1d0ul /* don't care */ | ||
| 45 | #define DSP_SPOS_DCDCHI 0x0badul | ||
| 46 | #define DSP_SPOS_DCDCLO 0xf1d0ul | ||
| 47 | |||
| 48 | #define DSP_MAX_TASK_NAME 60 | ||
| 49 | #define DSP_MAX_SYMBOL_NAME 100 | ||
| 50 | #define DSP_MAX_SCB_NAME 60 | ||
| 51 | #define DSP_MAX_SCB_DESC 200 | ||
| 52 | #define DSP_MAX_TASK_DESC 50 | ||
| 53 | |||
| 54 | #define DSP_MAX_PCM_CHANNELS 32 | ||
| 55 | #define DSP_MAX_SRC_NR 14 | ||
| 56 | |||
| 57 | #define DSP_PCM_MAIN_CHANNEL 1 | ||
| 58 | #define DSP_PCM_REAR_CHANNEL 2 | ||
| 59 | #define DSP_PCM_CENTER_LFE_CHANNEL 3 | ||
| 60 | #define DSP_PCM_S71_CHANNEL 4 /* surround 7.1 */ | ||
| 61 | #define DSP_IEC958_CHANNEL 5 | ||
| 62 | |||
| 63 | #define DSP_SPDIF_STATUS_OUTPUT_ENABLED 1 | ||
| 64 | #define DSP_SPDIF_STATUS_PLAYBACK_OPEN 2 | ||
| 65 | #define DSP_SPDIF_STATUS_HW_ENABLED 4 | ||
| 66 | #define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8 | ||
| 67 | |||
| 68 | struct dsp_symbol_entry { | ||
| 69 | u32 address; | ||
| 70 | char symbol_name[DSP_MAX_SYMBOL_NAME]; | ||
| 71 | int symbol_type; | ||
| 72 | |||
| 73 | /* initialized by driver */ | ||
| 74 | struct dsp_module_desc * module; | ||
| 75 | int deleted; | ||
| 76 | }; | ||
| 77 | |||
| 78 | struct dsp_symbol_desc { | ||
| 79 | int nsymbols; | ||
| 80 | |||
| 81 | struct dsp_symbol_entry *symbols; | ||
| 82 | |||
| 83 | /* initialized by driver */ | ||
| 84 | int highest_frag_index; | ||
| 85 | }; | ||
| 86 | |||
| 87 | struct dsp_segment_desc { | ||
| 88 | int segment_type; | ||
| 89 | u32 offset; | ||
| 90 | u32 size; | ||
| 91 | u32 * data; | ||
| 92 | }; | ||
| 93 | |||
| 94 | struct dsp_module_desc { | ||
| 95 | char * module_name; | ||
| 96 | struct dsp_symbol_desc symbol_table; | ||
| 97 | int nsegments; | ||
| 98 | struct dsp_segment_desc * segments; | ||
| 99 | |||
| 100 | /* initialized by driver */ | ||
| 101 | u32 overlay_begin_address; | ||
| 102 | u32 load_address; | ||
| 103 | int nfixups; | ||
| 104 | }; | ||
| 105 | |||
| 106 | struct dsp_scb_descriptor { | ||
| 107 | char scb_name[DSP_MAX_SCB_NAME]; | ||
| 108 | u32 address; | ||
| 109 | int index; | ||
| 110 | u32 *data; | ||
| 111 | |||
| 112 | struct dsp_scb_descriptor * sub_list_ptr; | ||
| 113 | struct dsp_scb_descriptor * next_scb_ptr; | ||
| 114 | struct dsp_scb_descriptor * parent_scb_ptr; | ||
| 115 | |||
| 116 | struct dsp_symbol_entry * task_entry; | ||
| 117 | struct dsp_symbol_entry * scb_symbol; | ||
| 118 | |||
| 119 | struct snd_info_entry *proc_info; | ||
| 120 | int ref_count; | ||
| 121 | |||
| 122 | u16 volume[2]; | ||
| 123 | unsigned int deleted :1; | ||
| 124 | unsigned int updated :1; | ||
| 125 | unsigned int volume_set :1; | ||
| 126 | }; | ||
| 127 | |||
| 128 | struct dsp_task_descriptor { | ||
| 129 | char task_name[DSP_MAX_TASK_NAME]; | ||
| 130 | int size; | ||
| 131 | u32 address; | ||
| 132 | int index; | ||
| 133 | u32 *data; | ||
| 134 | }; | ||
| 135 | |||
| 136 | struct dsp_pcm_channel_descriptor { | ||
| 137 | int active; | ||
| 138 | int src_slot; | ||
| 139 | int pcm_slot; | ||
| 140 | u32 sample_rate; | ||
| 141 | u32 unlinked; | ||
| 142 | struct dsp_scb_descriptor * pcm_reader_scb; | ||
| 143 | struct dsp_scb_descriptor * src_scb; | ||
| 144 | struct dsp_scb_descriptor * mixer_scb; | ||
| 145 | |||
| 146 | void * private_data; | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct dsp_spos_instance { | ||
| 150 | struct dsp_symbol_desc symbol_table; /* currently available loaded symbols in SP */ | ||
| 151 | |||
| 152 | int nmodules; | ||
| 153 | struct dsp_module_desc * modules; /* modules loaded into SP */ | ||
| 154 | |||
| 155 | struct dsp_segment_desc code; | ||
| 156 | |||
| 157 | /* Main PCM playback mixer */ | ||
| 158 | struct dsp_scb_descriptor * master_mix_scb; | ||
| 159 | u16 dac_volume_right; | ||
| 160 | u16 dac_volume_left; | ||
| 161 | |||
| 162 | /* Rear/surround PCM playback mixer */ | ||
| 163 | struct dsp_scb_descriptor * rear_mix_scb; | ||
| 164 | |||
| 165 | /* Center/LFE mixer */ | ||
| 166 | struct dsp_scb_descriptor * center_lfe_mix_scb; | ||
| 167 | |||
| 168 | int npcm_channels; | ||
| 169 | int nsrc_scb; | ||
| 170 | struct dsp_pcm_channel_descriptor pcm_channels[DSP_MAX_PCM_CHANNELS]; | ||
| 171 | int src_scb_slots[DSP_MAX_SRC_NR]; | ||
| 172 | |||
| 173 | /* cache this symbols */ | ||
| 174 | struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */ | ||
| 175 | struct dsp_symbol_entry * s16_up; /* used by SRCtaskSCB's */ | ||
| 176 | |||
| 177 | /* proc fs */ | ||
| 178 | struct snd_card *snd_card; | ||
| 179 | struct snd_info_entry * proc_dsp_dir; | ||
| 180 | struct snd_info_entry * proc_sym_info_entry; | ||
| 181 | struct snd_info_entry * proc_modules_info_entry; | ||
| 182 | struct snd_info_entry * proc_parameter_dump_info_entry; | ||
| 183 | struct snd_info_entry * proc_sample_dump_info_entry; | ||
| 184 | |||
| 185 | /* SCB's descriptors */ | ||
| 186 | int nscb; | ||
| 187 | int scb_highest_frag_index; | ||
| 188 | struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC]; | ||
| 189 | struct snd_info_entry * proc_scb_info_entry; | ||
| 190 | struct dsp_scb_descriptor * the_null_scb; | ||
| 191 | |||
| 192 | /* Task's descriptors */ | ||
| 193 | int ntask; | ||
| 194 | struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC]; | ||
| 195 | struct snd_info_entry * proc_task_info_entry; | ||
| 196 | |||
| 197 | /* SPDIF status */ | ||
| 198 | int spdif_status_out; | ||
| 199 | int spdif_status_in; | ||
| 200 | u16 spdif_input_volume_right; | ||
| 201 | u16 spdif_input_volume_left; | ||
| 202 | /* spdif channel status, | ||
| 203 | left right and user validity bits */ | ||
| 204 | unsigned int spdif_csuv_default; | ||
| 205 | unsigned int spdif_csuv_stream; | ||
| 206 | |||
| 207 | /* SPDIF input sample rate converter */ | ||
| 208 | struct dsp_scb_descriptor * spdif_in_src; | ||
| 209 | /* SPDIF input asynch. receiver */ | ||
| 210 | struct dsp_scb_descriptor * asynch_rx_scb; | ||
| 211 | |||
| 212 | /* Capture record mixer SCB */ | ||
| 213 | struct dsp_scb_descriptor * record_mixer_scb; | ||
| 214 | |||
| 215 | /* CODEC input SCB */ | ||
| 216 | struct dsp_scb_descriptor * codec_in_scb; | ||
| 217 | |||
| 218 | /* reference snooper */ | ||
| 219 | struct dsp_scb_descriptor * ref_snoop_scb; | ||
| 220 | |||
| 221 | /* SPDIF output PCM reference */ | ||
| 222 | struct dsp_scb_descriptor * spdif_pcm_input_scb; | ||
| 223 | |||
| 224 | /* asynch TX task */ | ||
| 225 | struct dsp_scb_descriptor * asynch_tx_scb; | ||
| 226 | |||
| 227 | /* record sources */ | ||
| 228 | struct dsp_scb_descriptor * pcm_input; | ||
| 229 | struct dsp_scb_descriptor * adc_input; | ||
| 230 | |||
| 231 | int spdif_in_sample_rate; | ||
| 232 | }; | ||
| 233 | |||
| 234 | #endif /* __DSP_SPOS_H__ */ | ||
diff --git a/include/sound/cs46xx_dsp_task_types.h b/include/sound/cs46xx_dsp_task_types.h deleted file mode 100644 index 5cf920bfda27..000000000000 --- a/include/sound/cs46xx_dsp_task_types.h +++ /dev/null | |||
| @@ -1,252 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * The driver for the Cirrus Logic's Sound Fusion CS46XX based soundcards | ||
| 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> | ||
| 4 | * | ||
| 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 | * NOTE: comments are copy/paste from cwcemb80.lst | ||
| 22 | * provided by Tom Woller at Cirrus (my only | ||
| 23 | * documentation about the SP OS running inside | ||
| 24 | * the DSP) | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __CS46XX_DSP_TASK_TYPES_H__ | ||
| 28 | #define __CS46XX_DSP_TASK_TYPES_H__ | ||
| 29 | |||
| 30 | #include "cs46xx_dsp_scb_types.h" | ||
| 31 | |||
| 32 | /********************************************************************************************* | ||
| 33 | Example hierarchy of stream control blocks in the SP | ||
| 34 | |||
| 35 | hfgTree | ||
| 36 | Ptr____Call (c) | ||
| 37 | \ | ||
| 38 | -------+------ ------------- ------------- ------------- ----- | ||
| 39 | | SBlaster IF |______\| Foreground |___\| Middlegr'nd |___\| Background |___\| Nul | | ||
| 40 | | |Goto /| tree header |g /| tree header |g /| tree header |g /| SCB |r | ||
| 41 | -------------- (g) ------------- ------------- ------------- ----- | ||
| 42 | |c |c |c |c | ||
| 43 | | | | | | ||
| 44 | \/ ------------- ------------- ------------- | ||
| 45 | | Foreground |_\ | Middlegr'nd |_\ | Background |_\ | ||
| 46 | | tree |g/ | tree |g/ | tree |g/ | ||
| 47 | ------------- ------------- ------------- | ||
| 48 | |c |c |c | ||
| 49 | | | | | ||
| 50 | \/ \/ \/ | ||
| 51 | |||
| 52 | *********************************************************************************************/ | ||
| 53 | |||
| 54 | #define HFG_FIRST_EXECUTE_MODE 0x0001 | ||
| 55 | #define HFG_FIRST_EXECUTE_MODE_BIT 0 | ||
| 56 | #define HFG_CONTEXT_SWITCH_MODE 0x0002 | ||
| 57 | #define HFG_CONTEXT_SWITCH_MODE_BIT 1 | ||
| 58 | |||
| 59 | #define MAX_FG_STACK_SIZE 32 /* THESE NEED TO BE COMPUTED PROPERLY */ | ||
| 60 | #define MAX_MG_STACK_SIZE 16 | ||
| 61 | #define MAX_BG_STACK_SIZE 9 | ||
| 62 | #define MAX_HFG_STACK_SIZE 4 | ||
| 63 | |||
| 64 | #define SLEEP_ACTIVE_INCREMENT 0 /* Enable task tree thread to go to sleep | ||
| 65 | This should only ever be used on the Background thread */ | ||
| 66 | #define STANDARD_ACTIVE_INCREMENT 1 /* Task tree thread normal operation */ | ||
| 67 | #define SUSPEND_ACTIVE_INCREMENT 2 /* Cause execution to suspend in the task tree thread | ||
| 68 | This should only ever be used on the Background thread */ | ||
| 69 | |||
| 70 | #define HOSTFLAGS_DISABLE_BG_SLEEP 0 /* Host-controlled flag that determines whether we go to sleep | ||
| 71 | at the end of BG */ | ||
| 72 | |||
| 73 | /* Minimal context save area for Hyper Forground */ | ||
| 74 | struct dsp_hf_save_area { | ||
| 75 | u32 r10_save; | ||
| 76 | u32 r54_save; | ||
| 77 | u32 r98_save; | ||
| 78 | |||
| 79 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 80 | status_save, | ||
| 81 | ind_save | ||
| 82 | ) | ||
| 83 | |||
| 84 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 85 | rci1_save, | ||
| 86 | rci0_save | ||
| 87 | ) | ||
| 88 | |||
| 89 | u32 r32_save; | ||
| 90 | u32 r76_save; | ||
| 91 | u32 rsd2_save; | ||
| 92 | |||
| 93 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 94 | rsi2_save, /* See TaskTreeParameterBlock for | ||
| 95 | remainder of registers */ | ||
| 96 | rsa2Save | ||
| 97 | ) | ||
| 98 | /* saved as part of HFG context */ | ||
| 99 | }; | ||
| 100 | |||
| 101 | |||
| 102 | /* Task link data structure */ | ||
| 103 | struct dsp_tree_link { | ||
| 104 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 105 | /* Pointer to sibling task control block */ | ||
| 106 | next_scb, | ||
| 107 | /* Pointer to child task control block */ | ||
| 108 | sub_ptr | ||
| 109 | ) | ||
| 110 | |||
| 111 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 112 | /* Pointer to code entry point */ | ||
| 113 | entry_point, | ||
| 114 | /* Pointer to local data */ | ||
| 115 | this_spb | ||
| 116 | ) | ||
| 117 | }; | ||
| 118 | |||
| 119 | |||
| 120 | struct dsp_task_tree_data { | ||
| 121 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 122 | /* Initial tock count; controls task tree execution rate */ | ||
| 123 | tock_count_limit, | ||
| 124 | /* Tock down counter */ | ||
| 125 | tock_count | ||
| 126 | ) | ||
| 127 | |||
| 128 | /* Add to ActiveCount when TockCountLimit reached: | ||
| 129 | Subtract on task tree termination */ | ||
| 130 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 131 | active_tncrement, | ||
| 132 | /* Number of pending activations for task tree */ | ||
| 133 | active_count | ||
| 134 | ) | ||
| 135 | |||
| 136 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 137 | /* BitNumber to enable modification of correct bit in ActiveTaskFlags */ | ||
| 138 | active_bit, | ||
| 139 | /* Pointer to OS location for indicating current activity on task level */ | ||
| 140 | active_task_flags_ptr | ||
| 141 | ) | ||
| 142 | |||
| 143 | /* Data structure for controlling movement of memory blocks:- | ||
| 144 | currently unused */ | ||
| 145 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 146 | mem_upd_ptr, | ||
| 147 | /* Data structure for controlling synchronous link update */ | ||
| 148 | link_upd_ptr | ||
| 149 | ) | ||
| 150 | |||
| 151 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 152 | /* Save area for remainder of full context. */ | ||
| 153 | save_area, | ||
| 154 | /* Address of start of local stack for data storage */ | ||
| 155 | data_stack_base_ptr | ||
| 156 | ) | ||
| 157 | |||
| 158 | }; | ||
| 159 | |||
| 160 | |||
| 161 | struct dsp_interval_timer_data | ||
| 162 | { | ||
| 163 | /* These data items have the same relative locations to those */ | ||
| 164 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 165 | interval_timer_period, | ||
| 166 | itd_unused | ||
| 167 | ) | ||
| 168 | |||
| 169 | /* used for this data in the SPOS control block for SPOS 1.0 */ | ||
| 170 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 171 | num_FG_ticks_this_interval, | ||
| 172 | num_intervals | ||
| 173 | ) | ||
| 174 | }; | ||
| 175 | |||
| 176 | |||
| 177 | /* This structure contains extra storage for the task tree | ||
| 178 | Currently, this additional data is related only to a full context save */ | ||
| 179 | struct dsp_task_tree_context_block { | ||
| 180 | /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for | ||
| 181 | The access to the context switch (call or interrupt), and 1 spare that | ||
| 182 | users should never use. This last may be required by the system */ | ||
| 183 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 184 | stack1, | ||
| 185 | stack0 | ||
| 186 | ) | ||
| 187 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 188 | stack3, | ||
| 189 | stack2 | ||
| 190 | ) | ||
| 191 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 192 | stack5, | ||
| 193 | stack4 | ||
| 194 | ) | ||
| 195 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 196 | stack7, | ||
| 197 | stack6 | ||
| 198 | ) | ||
| 199 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 200 | stack9, | ||
| 201 | stack8 | ||
| 202 | ) | ||
| 203 | |||
| 204 | u32 saverfe; | ||
| 205 | |||
| 206 | /* Value may be overwriten by stack save algorithm. | ||
| 207 | Retain the size of the stack data saved here if used */ | ||
| 208 | ___DSP_DUAL_16BIT_ALLOC( | ||
| 209 | reserved1, | ||
| 210 | stack_size | ||
| 211 | ) | ||
| 212 | u32 saverba; /* (HFG) */ | ||
| 213 | u32 saverdc; | ||
| 214 | u32 savers_config_23; /* (HFG) */ | ||
| 215 | u32 savers_DMA23; /* (HFG) */ | ||
| 216 | u32 saversa0; | ||
| 217 | u32 saversi0; | ||
| 218 | u32 saversa1; | ||
| 219 | u32 saversi1; | ||
| 220 | u32 saversa3; | ||
| 221 | u32 saversd0; | ||
| 222 | u32 saversd1; | ||
| 223 | u32 saversd3; | ||
| 224 | u32 savers_config01; | ||
| 225 | u32 savers_DMA01; | ||
| 226 | u32 saveacc0hl; | ||
| 227 | u32 saveacc1hl; | ||
| 228 | u32 saveacc0xacc1x; | ||
| 229 | u32 saveacc2hl; | ||
| 230 | u32 saveacc3hl; | ||
| 231 | u32 saveacc2xacc3x; | ||
| 232 | u32 saveaux0hl; | ||
| 233 | u32 saveaux1hl; | ||
| 234 | u32 saveaux0xaux1x; | ||
| 235 | u32 saveaux2hl; | ||
| 236 | u32 saveaux3hl; | ||
| 237 | u32 saveaux2xaux3x; | ||
| 238 | u32 savershouthl; | ||
| 239 | u32 savershoutxmacmode; | ||
| 240 | }; | ||
| 241 | |||
| 242 | |||
| 243 | struct dsp_task_tree_control_block { | ||
| 244 | struct dsp_hf_save_area context; | ||
| 245 | struct dsp_tree_link links; | ||
| 246 | struct dsp_task_tree_data data; | ||
| 247 | struct dsp_task_tree_context_block context_blk; | ||
| 248 | struct dsp_interval_timer_data int_timer; | ||
| 249 | }; | ||
| 250 | |||
| 251 | |||
| 252 | #endif /* __DSP_TASK_TYPES_H__ */ | ||
diff --git a/include/sound/designware_i2s.h b/include/sound/designware_i2s.h new file mode 100644 index 000000000000..26f406e0f673 --- /dev/null +++ b/include/sound/designware_i2s.h | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __SOUND_DESIGNWARE_I2S_H | ||
| 21 | #define __SOUND_DESIGNWARE_I2S_H | ||
| 22 | |||
| 23 | #include <linux/dmaengine.h> | ||
| 24 | #include <linux/types.h> | ||
| 25 | |||
| 26 | /* | ||
| 27 | * struct i2s_clk_config_data - represent i2s clk configuration data | ||
| 28 | * @chan_nr: number of channel | ||
| 29 | * @data_width: number of bits per sample (8/16/24/32 bit) | ||
| 30 | * @sample_rate: sampling frequency (8Khz, 16Khz, 32Khz, 44Khz, 48Khz) | ||
| 31 | */ | ||
| 32 | struct i2s_clk_config_data { | ||
| 33 | int chan_nr; | ||
| 34 | u32 data_width; | ||
| 35 | u32 sample_rate; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct i2s_platform_data { | ||
| 39 | #define DWC_I2S_PLAY (1 << 0) | ||
| 40 | #define DWC_I2S_RECORD (1 << 1) | ||
| 41 | unsigned int cap; | ||
| 42 | int channel; | ||
| 43 | u32 snd_fmts; | ||
| 44 | u32 snd_rates; | ||
| 45 | |||
| 46 | void *play_dma_data; | ||
| 47 | void *capture_dma_data; | ||
| 48 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
| 49 | int (*i2s_clk_cfg)(struct i2s_clk_config_data *config); | ||
| 50 | }; | ||
| 51 | |||
| 52 | struct i2s_dma_data { | ||
| 53 | void *data; | ||
| 54 | dma_addr_t addr; | ||
| 55 | u32 max_burst; | ||
| 56 | enum dma_slave_buswidth addr_width; | ||
| 57 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
| 58 | }; | ||
| 59 | |||
| 60 | /* I2S DMA registers */ | ||
| 61 | #define I2S_RXDMA 0x01C0 | ||
| 62 | #define I2S_TXDMA 0x01C8 | ||
| 63 | |||
| 64 | #define TWO_CHANNEL_SUPPORT 2 /* up to 2.0 */ | ||
| 65 | #define FOUR_CHANNEL_SUPPORT 4 /* up to 3.1 */ | ||
| 66 | #define SIX_CHANNEL_SUPPORT 6 /* up to 5.1 */ | ||
| 67 | #define EIGHT_CHANNEL_SUPPORT 8 /* up to 7.1 */ | ||
| 68 | |||
| 69 | #endif /* __SOUND_DESIGNWARE_I2S_H */ | ||
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index a8fcaa6d531f..b877334bbb0f 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h | |||
| @@ -39,6 +39,7 @@ int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, | |||
| 39 | const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); | 39 | const struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config); |
| 40 | int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd); | 40 | int snd_dmaengine_pcm_trigger(struct snd_pcm_substream *substream, int cmd); |
| 41 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream); | 41 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer(struct snd_pcm_substream *substream); |
| 42 | snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream *substream); | ||
| 42 | 43 | ||
| 43 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, | 44 | int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream, |
| 44 | dma_filter_fn filter_fn, void *filter_data); | 45 | dma_filter_fn filter_fn, void *filter_data); |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 0d1112815be3..c75c0d1a85e2 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -810,7 +810,7 @@ int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_pa | |||
| 810 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, | 810 | int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, |
| 811 | unsigned int cond, | 811 | unsigned int cond, |
| 812 | snd_pcm_hw_param_t var, | 812 | snd_pcm_hw_param_t var, |
| 813 | struct snd_pcm_hw_constraint_list *l); | 813 | const struct snd_pcm_hw_constraint_list *l); |
| 814 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, | 814 | int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, |
| 815 | unsigned int cond, | 815 | unsigned int cond, |
| 816 | snd_pcm_hw_param_t var, | 816 | snd_pcm_hw_param_t var, |
| @@ -893,6 +893,7 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates; | |||
| 893 | 893 | ||
| 894 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); | 894 | int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); |
| 895 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); | 895 | unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); |
| 896 | unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); | ||
| 896 | 897 | ||
| 897 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, | 898 | static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, |
| 898 | struct snd_dma_buffer *bufp) | 899 | struct snd_dma_buffer *bufp) |
| @@ -1073,4 +1074,15 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
| 1073 | 1074 | ||
| 1074 | const char *snd_pcm_format_name(snd_pcm_format_t format); | 1075 | const char *snd_pcm_format_name(snd_pcm_format_t format); |
| 1075 | 1076 | ||
| 1077 | /** | ||
| 1078 | * Get a string naming the direction of a stream | ||
| 1079 | */ | ||
| 1080 | static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream) | ||
| 1081 | { | ||
| 1082 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) | ||
| 1083 | return "Playback"; | ||
| 1084 | else | ||
| 1085 | return "Capture"; | ||
| 1086 | } | ||
| 1087 | |||
| 1076 | #endif /* __SOUND_PCM_H */ | 1088 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index f494f1e3c900..37ae12e0ab06 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | * | 22 | * |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | #include <sound/pcm.h> | ||
| 26 | |||
| 25 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, | 27 | int snd_pcm_hw_param_first(struct snd_pcm_substream *pcm, |
| 26 | struct snd_pcm_hw_params *params, | 28 | struct snd_pcm_hw_params *params, |
| 27 | snd_pcm_hw_param_t var, int *dir); | 29 | snd_pcm_hw_param_t var, int *dir); |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e3833d9f1914..abe373d57adc 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -229,6 +229,10 @@ struct device; | |||
| 229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 229 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
| 230 | .shift = wshift, .invert = winvert, \ | 230 | .shift = wshift, .invert = winvert, \ |
| 231 | .event = wevent, .event_flags = wflags} | 231 | .event = wevent, .event_flags = wflags} |
| 232 | #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ | ||
| 233 | { .id = snd_soc_dapm_clock_supply, .name = wname, \ | ||
| 234 | .reg = SND_SOC_NOPM, .event = dapm_clock_event, \ | ||
| 235 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } | ||
| 232 | 236 | ||
| 233 | /* generic widgets */ | 237 | /* generic widgets */ |
| 234 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 238 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
| @@ -245,6 +249,7 @@ struct device; | |||
| 245 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ | 249 | .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ |
| 246 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } | 250 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } |
| 247 | 251 | ||
| 252 | |||
| 248 | /* dapm kcontrol types */ | 253 | /* dapm kcontrol types */ |
| 249 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 254 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
| 250 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 255 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -327,6 +332,8 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w, | |||
| 327 | struct snd_kcontrol *kcontrol, int event); | 332 | struct snd_kcontrol *kcontrol, int event); |
| 328 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, | 333 | int dapm_regulator_event(struct snd_soc_dapm_widget *w, |
| 329 | struct snd_kcontrol *kcontrol, int event); | 334 | struct snd_kcontrol *kcontrol, int event); |
| 335 | int dapm_clock_event(struct snd_soc_dapm_widget *w, | ||
| 336 | struct snd_kcontrol *kcontrol, int event); | ||
| 330 | 337 | ||
| 331 | /* dapm controls */ | 338 | /* dapm controls */ |
| 332 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | 339 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, |
| @@ -367,6 +374,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); | |||
| 367 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); | 374 | void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); |
| 368 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, | 375 | int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, |
| 369 | const struct snd_soc_dapm_route *route, int num); | 376 | const struct snd_soc_dapm_route *route, int num); |
| 377 | int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, | ||
| 378 | const struct snd_soc_dapm_route *route, int num); | ||
| 370 | int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, | 379 | int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, |
| 371 | const struct snd_soc_dapm_route *route, int num); | 380 | const struct snd_soc_dapm_route *route, int num); |
| 372 | 381 | ||
| @@ -432,6 +441,7 @@ enum snd_soc_dapm_type { | |||
| 432 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 441 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
| 433 | snd_soc_dapm_supply, /* power/clock supply */ | 442 | snd_soc_dapm_supply, /* power/clock supply */ |
| 434 | snd_soc_dapm_regulator_supply, /* external regulator */ | 443 | snd_soc_dapm_regulator_supply, /* external regulator */ |
| 444 | snd_soc_dapm_clock_supply, /* external clock */ | ||
| 435 | snd_soc_dapm_aif_in, /* audio interface input */ | 445 | snd_soc_dapm_aif_in, /* audio interface input */ |
| 436 | snd_soc_dapm_aif_out, /* audio interface output */ | 446 | snd_soc_dapm_aif_out, /* audio interface output */ |
| 437 | snd_soc_dapm_siggen, /* signal generator */ | 447 | snd_soc_dapm_siggen, /* signal generator */ |
| @@ -537,6 +547,8 @@ struct snd_soc_dapm_widget { | |||
| 537 | struct list_head dirty; | 547 | struct list_head dirty; |
| 538 | int inputs; | 548 | int inputs; |
| 539 | int outputs; | 549 | int outputs; |
| 550 | |||
| 551 | struct clk *clk; | ||
| 540 | }; | 552 | }; |
| 541 | 553 | ||
| 542 | struct snd_soc_dapm_update { | 554 | struct snd_soc_dapm_update { |
diff --git a/include/sound/soc.h b/include/sound/soc.h index c703871f5f65..e063380f63a2 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -42,11 +42,22 @@ | |||
| 42 | ((unsigned long)&(struct soc_mixer_control) \ | 42 | ((unsigned long)&(struct soc_mixer_control) \ |
| 43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | 43 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ |
| 44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) | 44 | .max = xmax, .platform_max = xmax, .invert = xinvert}) |
| 45 | #define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ | ||
| 46 | ((unsigned long)&(struct soc_mixer_control) \ | ||
| 47 | {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ | ||
| 48 | .min = xmin, .max = xmax, .platform_max = xmax, .invert = xinvert}) | ||
| 45 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ | 49 | #define SOC_SINGLE(xname, reg, shift, max, invert) \ |
| 46 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 50 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 47 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ | 51 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ |
| 48 | .put = snd_soc_put_volsw, \ | 52 | .put = snd_soc_put_volsw, \ |
| 49 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } | 53 | .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } |
| 54 | #define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ | ||
| 55 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
| 56 | .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ | ||
| 57 | .put = snd_soc_put_volsw_range, \ | ||
| 58 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 59 | {.reg = xreg, .shift = xshift, .min = xmin,\ | ||
| 60 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 50 | #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ | 61 | #define SOC_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ |
| 51 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 62 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 52 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 63 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -67,6 +78,16 @@ | |||
| 67 | {.reg = xreg, .rreg = xreg, \ | 78 | {.reg = xreg, .rreg = xreg, \ |
| 68 | .shift = xshift, .rshift = xshift, \ | 79 | .shift = xshift, .rshift = xshift, \ |
| 69 | .max = xmax, .min = xmin} } | 80 | .max = xmax, .min = xmin} } |
| 81 | #define SOC_SINGLE_RANGE_TLV(xname, xreg, xshift, xmin, xmax, xinvert, tlv_array) \ | ||
| 82 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
| 83 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | ||
| 84 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
| 85 | .tlv.p = (tlv_array), \ | ||
| 86 | .info = snd_soc_info_volsw_range, \ | ||
| 87 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
| 88 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 89 | {.reg = xreg, .shift = xshift, .min = xmin,\ | ||
| 90 | .max = xmax, .platform_max = xmax, .invert = xinvert} } | ||
| 70 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ | 91 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, max, invert) \ |
| 71 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 92 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 72 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ | 93 | .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ |
| @@ -79,6 +100,13 @@ | |||
| 79 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ | 100 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
| 80 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ | 101 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
| 81 | xmax, xinvert) } | 102 | xmax, xinvert) } |
| 103 | #define SOC_DOUBLE_R_RANGE(xname, reg_left, reg_right, xshift, xmin, \ | ||
| 104 | xmax, xinvert) \ | ||
| 105 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
| 106 | .info = snd_soc_info_volsw_range, \ | ||
| 107 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
| 108 | .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ | ||
| 109 | xshift, xmin, xmax, xinvert) } | ||
| 82 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ | 110 | #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ |
| 83 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | 111 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ |
| 84 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | 112 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ |
| @@ -97,6 +125,16 @@ | |||
| 97 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ | 125 | .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ |
| 98 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ | 126 | .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ |
| 99 | xmax, xinvert) } | 127 | xmax, xinvert) } |
| 128 | #define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \ | ||
| 129 | xmax, xinvert, tlv_array) \ | ||
| 130 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
| 131 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ | ||
| 132 | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ | ||
| 133 | .tlv.p = (tlv_array), \ | ||
| 134 | .info = snd_soc_info_volsw_range, \ | ||
| 135 | .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ | ||
| 136 | .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ | ||
| 137 | xshift, xmin, xmax, xinvert) } | ||
| 100 | #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ | 138 | #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ |
| 101 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | 139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ |
| 102 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | 140 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ |
| @@ -460,6 +498,12 @@ int snd_soc_get_volsw_s8(struct snd_kcontrol *kcontrol, | |||
| 460 | struct snd_ctl_elem_value *ucontrol); | 498 | struct snd_ctl_elem_value *ucontrol); |
| 461 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, | 499 | int snd_soc_put_volsw_s8(struct snd_kcontrol *kcontrol, |
| 462 | struct snd_ctl_elem_value *ucontrol); | 500 | struct snd_ctl_elem_value *ucontrol); |
| 501 | int snd_soc_info_volsw_range(struct snd_kcontrol *kcontrol, | ||
| 502 | struct snd_ctl_elem_info *uinfo); | ||
| 503 | int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, | ||
| 504 | struct snd_ctl_elem_value *ucontrol); | ||
| 505 | int snd_soc_get_volsw_range(struct snd_kcontrol *kcontrol, | ||
| 506 | struct snd_ctl_elem_value *ucontrol); | ||
| 463 | int snd_soc_limit_volume(struct snd_soc_codec *codec, | 507 | int snd_soc_limit_volume(struct snd_soc_codec *codec, |
| 464 | const char *name, int max); | 508 | const char *name, int max); |
| 465 | int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, | 509 | int snd_soc_bytes_info(struct snd_kcontrol *kcontrol, |
| @@ -785,13 +829,36 @@ struct snd_soc_dai_link { | |||
| 785 | /* config - must be set by machine driver */ | 829 | /* config - must be set by machine driver */ |
| 786 | const char *name; /* Codec name */ | 830 | const char *name; /* Codec name */ |
| 787 | const char *stream_name; /* Stream name */ | 831 | const char *stream_name; /* Stream name */ |
| 788 | const char *codec_name; /* for multi-codec */ | 832 | /* |
| 789 | const struct device_node *codec_of_node; | 833 | * You MAY specify the link's CPU-side device, either by device name, |
| 790 | const char *platform_name; /* for multi-platform */ | 834 | * or by DT/OF node, but not both. If this information is omitted, |
| 791 | const struct device_node *platform_of_node; | 835 | * the CPU-side DAI is matched using .cpu_dai_name only, which hence |
| 836 | * must be globally unique. These fields are currently typically used | ||
| 837 | * only for codec to codec links, or systems using device tree. | ||
| 838 | */ | ||
| 839 | const char *cpu_name; | ||
| 840 | const struct device_node *cpu_of_node; | ||
| 841 | /* | ||
| 842 | * You MAY specify the DAI name of the CPU DAI. If this information is | ||
| 843 | * omitted, the CPU-side DAI is matched using .cpu_name/.cpu_of_node | ||
| 844 | * only, which only works well when that device exposes a single DAI. | ||
| 845 | */ | ||
| 792 | const char *cpu_dai_name; | 846 | const char *cpu_dai_name; |
| 793 | const struct device_node *cpu_dai_of_node; | 847 | /* |
| 848 | * You MUST specify the link's codec, either by device name, or by | ||
| 849 | * DT/OF node, but not both. | ||
| 850 | */ | ||
| 851 | const char *codec_name; | ||
| 852 | const struct device_node *codec_of_node; | ||
| 853 | /* You MUST specify the DAI name within the codec */ | ||
| 794 | const char *codec_dai_name; | 854 | const char *codec_dai_name; |
| 855 | /* | ||
| 856 | * You MAY specify the link's platform/PCM/DMA driver, either by | ||
| 857 | * device name, or by DT/OF node, but not both. Some forms of link | ||
| 858 | * do not need a platform. | ||
| 859 | */ | ||
| 860 | const char *platform_name; | ||
| 861 | const struct device_node *platform_of_node; | ||
| 795 | int be_id; /* optional ID for machine driver BE identification */ | 862 | int be_id; /* optional ID for machine driver BE identification */ |
| 796 | 863 | ||
| 797 | const struct snd_soc_pcm_stream *params; | 864 | const struct snd_soc_pcm_stream *params; |
diff --git a/include/sound/spear_dma.h b/include/sound/spear_dma.h new file mode 100644 index 000000000000..1b365bfdfb37 --- /dev/null +++ b/include/sound/spear_dma.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* | ||
| 2 | * linux/spear_dma.h | ||
| 3 | * | ||
| 4 | * Copyright (ST) 2012 Rajeev Kumar (rajeev-dlh.kumar@st.com) | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License 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 | |||
| 22 | #ifndef SPEAR_DMA_H | ||
| 23 | #define SPEAR_DMA_H | ||
| 24 | |||
| 25 | #include <linux/dmaengine.h> | ||
| 26 | |||
| 27 | struct spear_dma_data { | ||
| 28 | void *data; | ||
| 29 | dma_addr_t addr; | ||
| 30 | u32 max_burst; | ||
| 31 | enum dma_slave_buswidth addr_width; | ||
| 32 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
| 33 | }; | ||
| 34 | |||
| 35 | #endif /* SPEAR_DMA_H */ | ||
diff --git a/include/sound/spear_spdif.h b/include/sound/spear_spdif.h new file mode 100644 index 000000000000..a12f39695610 --- /dev/null +++ b/include/sound/spear_spdif.h | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (ST) 2012 Vipin Kumar (vipin.kumar@st.com) | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __SOUND_SPDIF_H | ||
| 20 | #define __SOUND_SPDIF_H | ||
| 21 | |||
| 22 | struct spear_spdif_platform_data { | ||
| 23 | /* DMA params */ | ||
| 24 | void *dma_params; | ||
| 25 | bool (*filter)(struct dma_chan *chan, void *slave); | ||
| 26 | void (*reset_perip)(void); | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif /* SOUND_SPDIF_H */ | ||
diff --git a/include/sound/tlv.h b/include/sound/tlv.h index 7067e2dfb0b9..a64d8fe3f855 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
| @@ -38,21 +38,31 @@ | |||
| 38 | #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ | 38 | #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ |
| 39 | #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ | 39 | #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ |
| 40 | 40 | ||
| 41 | #define TLV_ITEM(type, ...) \ | ||
| 42 | (type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__ | ||
| 43 | #define TLV_LENGTH(...) \ | ||
| 44 | ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ })) | ||
| 45 | |||
| 46 | #define TLV_CONTAINER_ITEM(...) \ | ||
| 47 | TLV_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__) | ||
| 48 | #define DECLARE_TLV_CONTAINER(name, ...) \ | ||
| 49 | unsigned int name[] = { TLV_CONTAINER_ITEM(__VA_ARGS__) } | ||
| 50 | |||
| 41 | #define TLV_DB_SCALE_MASK 0xffff | 51 | #define TLV_DB_SCALE_MASK 0xffff |
| 42 | #define TLV_DB_SCALE_MUTE 0x10000 | 52 | #define TLV_DB_SCALE_MUTE 0x10000 |
| 43 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ | 53 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ |
| 44 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ | 54 | TLV_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \ |
| 45 | (min), ((step) & TLV_DB_SCALE_MASK) | ((mute) ? TLV_DB_SCALE_MUTE : 0) | 55 | (min), \ |
| 56 | ((step) & TLV_DB_SCALE_MASK) | \ | ||
| 57 | ((mute) ? TLV_DB_SCALE_MUTE : 0)) | ||
| 46 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ | 58 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ |
| 47 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } | 59 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } |
| 48 | 60 | ||
| 49 | /* dB scale specified with min/max values instead of step */ | 61 | /* dB scale specified with min/max values instead of step */ |
| 50 | #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ | 62 | #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ |
| 51 | SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ | 63 | TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB)) |
| 52 | (min_dB), (max_dB) | ||
| 53 | #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ | 64 | #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ |
| 54 | SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ | 65 | TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB)) |
| 55 | (min_dB), (max_dB) | ||
| 56 | #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ | 66 | #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ |
| 57 | unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } | 67 | unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } |
| 58 | #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ | 68 | #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ |
| @@ -60,13 +70,16 @@ | |||
| 60 | 70 | ||
| 61 | /* linear volume between min_dB and max_dB (.01dB unit) */ | 71 | /* linear volume between min_dB and max_dB (.01dB unit) */ |
| 62 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ | 72 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ |
| 63 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ | 73 | TLV_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB)) |
| 64 | (min_dB), (max_dB) | ||
| 65 | #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ | 74 | #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \ |
| 66 | unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } | 75 | unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) } |
| 67 | 76 | ||
| 68 | /* dB range container */ | 77 | /* dB range container */ |
| 69 | /* Each item is: <min> <max> <TLV> */ | 78 | /* Each item is: <min> <max> <TLV> */ |
| 79 | #define TLV_DB_RANGE_ITEM(...) \ | ||
| 80 | TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__) | ||
| 81 | #define DECLARE_TLV_DB_RANGE(name, ...) \ | ||
| 82 | unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) } | ||
| 70 | /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ | 83 | /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ |
| 71 | #define TLV_DB_RANGE_HEAD(num) \ | 84 | #define TLV_DB_RANGE_HEAD(num) \ |
| 72 | SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) | 85 | SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) |
diff --git a/include/sound/trident.h b/include/sound/trident.h deleted file mode 100644 index 9f191a0a1e19..000000000000 --- a/include/sound/trident.h +++ /dev/null | |||
| @@ -1,445 +0,0 @@ | |||
| 1 | #ifndef __SOUND_TRIDENT_H | ||
| 2 | #define __SOUND_TRIDENT_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * audio@tridentmicro.com | ||
| 6 | * Fri Feb 19 15:55:28 MST 1999 | ||
| 7 | * Definitions for Trident 4DWave DX/NX chips | ||
| 8 | * | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (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 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 | #include "pcm.h" | ||
| 27 | #include "mpu401.h" | ||
| 28 | #include "ac97_codec.h" | ||
| 29 | #include "util_mem.h" | ||
| 30 | |||
| 31 | #define TRIDENT_DEVICE_ID_DX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_DX) | ||
| 32 | #define TRIDENT_DEVICE_ID_NX ((PCI_VENDOR_ID_TRIDENT<<16)|PCI_DEVICE_ID_TRIDENT_4DWAVE_NX) | ||
| 33 | #define TRIDENT_DEVICE_ID_SI7018 ((PCI_VENDOR_ID_SI<<16)|PCI_DEVICE_ID_SI_7018) | ||
| 34 | |||
| 35 | #define SNDRV_TRIDENT_VOICE_TYPE_PCM 0 | ||
| 36 | #define SNDRV_TRIDENT_VOICE_TYPE_SYNTH 1 | ||
| 37 | #define SNDRV_TRIDENT_VOICE_TYPE_MIDI 2 | ||
| 38 | |||
| 39 | #define SNDRV_TRIDENT_VFLG_RUNNING (1<<0) | ||
| 40 | |||
| 41 | /* TLB code constants */ | ||
| 42 | #define SNDRV_TRIDENT_PAGE_SIZE 4096 | ||
| 43 | #define SNDRV_TRIDENT_PAGE_SHIFT 12 | ||
| 44 | #define SNDRV_TRIDENT_PAGE_MASK ((1<<SNDRV_TRIDENT_PAGE_SHIFT)-1) | ||
| 45 | #define SNDRV_TRIDENT_MAX_PAGES 4096 | ||
| 46 | |||
| 47 | /* | ||
| 48 | * Direct registers | ||
| 49 | */ | ||
| 50 | |||
| 51 | #define TRID_REG(trident, x) ((trident)->port + (x)) | ||
| 52 | |||
| 53 | #define ID_4DWAVE_DX 0x2000 | ||
| 54 | #define ID_4DWAVE_NX 0x2001 | ||
| 55 | |||
| 56 | /* Bank definitions */ | ||
| 57 | |||
| 58 | #define T4D_BANK_A 0 | ||
| 59 | #define T4D_BANK_B 1 | ||
| 60 | #define T4D_NUM_BANKS 2 | ||
| 61 | |||
| 62 | /* Register definitions */ | ||
| 63 | |||
| 64 | /* Global registers */ | ||
| 65 | |||
| 66 | enum global_control_bits { | ||
| 67 | CHANNEL_IDX = 0x0000003f, | ||
| 68 | OVERRUN_IE = 0x00000400, /* interrupt enable: capture overrun */ | ||
| 69 | UNDERRUN_IE = 0x00000800, /* interrupt enable: playback underrun */ | ||
| 70 | ENDLP_IE = 0x00001000, /* interrupt enable: end of buffer */ | ||
| 71 | MIDLP_IE = 0x00002000, /* interrupt enable: middle buffer */ | ||
| 72 | ETOG_IE = 0x00004000, /* interrupt enable: envelope toggling */ | ||
| 73 | EDROP_IE = 0x00008000, /* interrupt enable: envelope drop */ | ||
| 74 | BANK_B_EN = 0x00010000, /* SiS: enable bank B (64 channels) */ | ||
| 75 | PCMIN_B_MIX = 0x00020000, /* SiS: PCM IN B mixing enable */ | ||
| 76 | I2S_OUT_ASSIGN = 0x00040000, /* SiS: I2S Out contains surround PCM */ | ||
| 77 | SPDIF_OUT_ASSIGN= 0x00080000, /* SiS: 0=S/PDIF L/R | 1=PCM Out FIFO */ | ||
| 78 | MAIN_OUT_ASSIGN = 0x00100000, /* SiS: 0=PCM Out FIFO | 1=MMC Out buffer */ | ||
| 79 | }; | ||
| 80 | |||
| 81 | enum miscint_bits { | ||
| 82 | PB_UNDERRUN_IRQ = 0x00000001, REC_OVERRUN_IRQ = 0x00000002, | ||
| 83 | SB_IRQ = 0x00000004, MPU401_IRQ = 0x00000008, | ||
| 84 | OPL3_IRQ = 0x00000010, ADDRESS_IRQ = 0x00000020, | ||
| 85 | ENVELOPE_IRQ = 0x00000040, PB_UNDERRUN = 0x00000100, | ||
| 86 | REC_OVERRUN = 0x00000200, MIXER_UNDERFLOW = 0x00000400, | ||
| 87 | MIXER_OVERFLOW = 0x00000800, NX_SB_IRQ_DISABLE = 0x00001000, | ||
| 88 | ST_TARGET_REACHED = 0x00008000, | ||
| 89 | PB_24K_MODE = 0x00010000, ST_IRQ_EN = 0x00800000, | ||
| 90 | ACGPIO_IRQ = 0x01000000 | ||
| 91 | }; | ||
| 92 | |||
| 93 | /* T2 legacy dma control registers. */ | ||
| 94 | #define LEGACY_DMAR0 0x00 // ADR0 | ||
| 95 | #define LEGACY_DMAR4 0x04 // CNT0 | ||
| 96 | #define LEGACY_DMAR6 0x06 // CNT0 - High bits | ||
| 97 | #define LEGACY_DMAR11 0x0b // MOD | ||
| 98 | #define LEGACY_DMAR15 0x0f // MMR | ||
| 99 | |||
| 100 | #define T4D_START_A 0x80 | ||
| 101 | #define T4D_STOP_A 0x84 | ||
| 102 | #define T4D_DLY_A 0x88 | ||
| 103 | #define T4D_SIGN_CSO_A 0x8c | ||
| 104 | #define T4D_CSPF_A 0x90 | ||
| 105 | #define T4D_CSPF_B 0xbc | ||
| 106 | #define T4D_CEBC_A 0x94 | ||
| 107 | #define T4D_AINT_A 0x98 | ||
| 108 | #define T4D_AINTEN_A 0x9c | ||
| 109 | #define T4D_LFO_GC_CIR 0xa0 | ||
| 110 | #define T4D_MUSICVOL_WAVEVOL 0xa8 | ||
| 111 | #define T4D_SBDELTA_DELTA_R 0xac | ||
| 112 | #define T4D_MISCINT 0xb0 | ||
| 113 | #define T4D_START_B 0xb4 | ||
| 114 | #define T4D_STOP_B 0xb8 | ||
| 115 | #define T4D_SBBL_SBCL 0xc0 | ||
| 116 | #define T4D_SBCTRL_SBE2R_SBDD 0xc4 | ||
| 117 | #define T4D_STIMER 0xc8 | ||
| 118 | #define T4D_AINT_B 0xd8 | ||
| 119 | #define T4D_AINTEN_B 0xdc | ||
| 120 | #define T4D_RCI 0x70 | ||
| 121 | |||
| 122 | /* MPU-401 UART */ | ||
| 123 | #define T4D_MPU401_BASE 0x20 | ||
| 124 | #define T4D_MPUR0 0x20 | ||
| 125 | #define T4D_MPUR1 0x21 | ||
| 126 | #define T4D_MPUR2 0x22 | ||
| 127 | #define T4D_MPUR3 0x23 | ||
| 128 | |||
| 129 | /* S/PDIF Registers */ | ||
| 130 | #define NX_SPCTRL_SPCSO 0x24 | ||
| 131 | #define NX_SPLBA 0x28 | ||
| 132 | #define NX_SPESO 0x2c | ||
| 133 | #define NX_SPCSTATUS 0x64 | ||
| 134 | |||
| 135 | /* Joystick */ | ||
| 136 | #define GAMEPORT_GCR 0x30 | ||
| 137 | #define GAMEPORT_MODE_ADC 0x80 | ||
| 138 | #define GAMEPORT_LEGACY 0x31 | ||
| 139 | #define GAMEPORT_AXES 0x34 | ||
| 140 | |||
| 141 | /* NX Specific Registers */ | ||
| 142 | #define NX_TLBC 0x6c | ||
| 143 | |||
| 144 | /* Channel Registers */ | ||
| 145 | |||
| 146 | #define CH_START 0xe0 | ||
| 147 | |||
| 148 | #define CH_DX_CSO_ALPHA_FMS 0xe0 | ||
| 149 | #define CH_DX_ESO_DELTA 0xe8 | ||
| 150 | #define CH_DX_FMC_RVOL_CVOL 0xec | ||
| 151 | |||
| 152 | #define CH_NX_DELTA_CSO 0xe0 | ||
| 153 | #define CH_NX_DELTA_ESO 0xe8 | ||
| 154 | #define CH_NX_ALPHA_FMS_FMC_RVOL_CVOL 0xec | ||
| 155 | |||
| 156 | #define CH_LBA 0xe4 | ||
| 157 | #define CH_GVSEL_PAN_VOL_CTRL_EC 0xf0 | ||
| 158 | #define CH_EBUF1 0xf4 | ||
| 159 | #define CH_EBUF2 0xf8 | ||
| 160 | |||
| 161 | /* AC-97 Registers */ | ||
| 162 | |||
| 163 | #define DX_ACR0_AC97_W 0x40 | ||
| 164 | #define DX_ACR1_AC97_R 0x44 | ||
| 165 | #define DX_ACR2_AC97_COM_STAT 0x48 | ||
| 166 | |||
| 167 | #define NX_ACR0_AC97_COM_STAT 0x40 | ||
| 168 | #define NX_ACR1_AC97_W 0x44 | ||
| 169 | #define NX_ACR2_AC97_R_PRIMARY 0x48 | ||
| 170 | #define NX_ACR3_AC97_R_SECONDARY 0x4c | ||
| 171 | |||
| 172 | #define SI_AC97_WRITE 0x40 | ||
| 173 | #define SI_AC97_READ 0x44 | ||
| 174 | #define SI_SERIAL_INTF_CTRL 0x48 | ||
| 175 | #define SI_AC97_GPIO 0x4c | ||
| 176 | #define SI_ASR0 0x50 | ||
| 177 | #define SI_SPDIF_CS 0x70 | ||
| 178 | #define SI_GPIO 0x7c | ||
| 179 | |||
| 180 | enum trident_nx_ac97_bits { | ||
| 181 | /* ACR1-3 */ | ||
| 182 | NX_AC97_BUSY_WRITE = 0x0800, | ||
| 183 | NX_AC97_BUSY_READ = 0x0800, | ||
| 184 | NX_AC97_BUSY_DATA = 0x0400, | ||
| 185 | NX_AC97_WRITE_SECONDARY = 0x0100, | ||
| 186 | /* ACR0 */ | ||
| 187 | NX_AC97_SECONDARY_READY = 0x0040, | ||
| 188 | NX_AC97_SECONDARY_RECORD = 0x0020, | ||
| 189 | NX_AC97_SURROUND_OUTPUT = 0x0010, | ||
| 190 | NX_AC97_PRIMARY_READY = 0x0008, | ||
| 191 | NX_AC97_PRIMARY_RECORD = 0x0004, | ||
| 192 | NX_AC97_PCM_OUTPUT = 0x0002, | ||
| 193 | NX_AC97_WARM_RESET = 0x0001 | ||
| 194 | }; | ||
| 195 | |||
| 196 | enum trident_dx_ac97_bits { | ||
| 197 | DX_AC97_BUSY_WRITE = 0x8000, | ||
| 198 | DX_AC97_BUSY_READ = 0x8000, | ||
| 199 | DX_AC97_READY = 0x0010, | ||
| 200 | DX_AC97_RECORD = 0x0008, | ||
| 201 | DX_AC97_PLAYBACK = 0x0002 | ||
| 202 | }; | ||
| 203 | |||
| 204 | enum sis7018_ac97_bits { | ||
| 205 | SI_AC97_BUSY_WRITE = 0x00008000, | ||
| 206 | SI_AC97_AUDIO_BUSY = 0x00004000, | ||
| 207 | SI_AC97_MODEM_BUSY = 0x00002000, | ||
| 208 | SI_AC97_BUSY_READ = 0x00008000, | ||
| 209 | SI_AC97_SECONDARY = 0x00000080, | ||
| 210 | }; | ||
| 211 | |||
| 212 | enum serial_intf_ctrl_bits { | ||
| 213 | WARM_RESET = 0x00000001, | ||
| 214 | COLD_RESET = 0x00000002, | ||
| 215 | I2S_CLOCK = 0x00000004, | ||
| 216 | PCM_SEC_AC97 = 0x00000008, | ||
| 217 | AC97_DBL_RATE = 0x00000010, | ||
| 218 | SPDIF_EN = 0x00000020, | ||
| 219 | I2S_OUTPUT_EN = 0x00000040, | ||
| 220 | I2S_INPUT_EN = 0x00000080, | ||
| 221 | PCMIN = 0x00000100, | ||
| 222 | LINE1IN = 0x00000200, | ||
| 223 | MICIN = 0x00000400, | ||
| 224 | LINE2IN = 0x00000800, | ||
| 225 | HEAD_SET_IN = 0x00001000, | ||
| 226 | GPIOIN = 0x00002000, | ||
| 227 | /* 7018 spec says id = 01 but the demo board routed to 10 | ||
| 228 | SECONDARY_ID= 0x00004000, */ | ||
| 229 | SECONDARY_ID = 0x00004000, | ||
| 230 | PCMOUT = 0x00010000, | ||
| 231 | SURROUT = 0x00020000, | ||
| 232 | CENTEROUT = 0x00040000, | ||
| 233 | LFEOUT = 0x00080000, | ||
| 234 | LINE1OUT = 0x00100000, | ||
| 235 | LINE2OUT = 0x00200000, | ||
| 236 | GPIOOUT = 0x00400000, | ||
| 237 | SI_AC97_PRIMARY_READY = 0x01000000, | ||
| 238 | SI_AC97_SECONDARY_READY = 0x02000000, | ||
| 239 | SI_AC97_POWERDOWN = 0x04000000, | ||
| 240 | }; | ||
| 241 | |||
| 242 | /* PCM defaults */ | ||
| 243 | |||
| 244 | #define T4D_DEFAULT_PCM_VOL 10 /* 0 - 255 */ | ||
| 245 | #define T4D_DEFAULT_PCM_PAN 0 /* 0 - 127 */ | ||
| 246 | #define T4D_DEFAULT_PCM_RVOL 127 /* 0 - 127 */ | ||
| 247 | #define T4D_DEFAULT_PCM_CVOL 127 /* 0 - 127 */ | ||
| 248 | |||
| 249 | struct snd_trident; | ||
| 250 | struct snd_trident_voice; | ||
| 251 | struct snd_trident_pcm_mixer; | ||
| 252 | |||
| 253 | struct snd_trident_port { | ||
| 254 | struct snd_midi_channel_set * chset; | ||
| 255 | struct snd_trident * trident; | ||
| 256 | int mode; /* operation mode */ | ||
| 257 | int client; /* sequencer client number */ | ||
| 258 | int port; /* sequencer port number */ | ||
| 259 | unsigned int midi_has_voices: 1; | ||
| 260 | }; | ||
| 261 | |||
| 262 | struct snd_trident_memblk_arg { | ||
| 263 | short first_page, last_page; | ||
| 264 | }; | ||
| 265 | |||
| 266 | struct snd_trident_tlb { | ||
| 267 | unsigned int * entries; /* 16k-aligned TLB table */ | ||
| 268 | dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */ | ||
| 269 | unsigned long * shadow_entries; /* shadow entries with virtual addresses */ | ||
| 270 | struct snd_dma_buffer buffer; | ||
| 271 | struct snd_util_memhdr * memhdr; /* page allocation list */ | ||
| 272 | struct snd_dma_buffer silent_page; | ||
| 273 | }; | ||
| 274 | |||
| 275 | struct snd_trident_voice { | ||
| 276 | unsigned int number; | ||
| 277 | unsigned int use: 1, | ||
| 278 | pcm: 1, | ||
| 279 | synth:1, | ||
| 280 | midi: 1; | ||
| 281 | unsigned int flags; | ||
| 282 | unsigned char client; | ||
| 283 | unsigned char port; | ||
| 284 | unsigned char index; | ||
| 285 | |||
| 286 | struct snd_trident_sample_ops *sample_ops; | ||
| 287 | |||
| 288 | /* channel parameters */ | ||
| 289 | unsigned int CSO; /* 24 bits (16 on DX) */ | ||
| 290 | unsigned int ESO; /* 24 bits (16 on DX) */ | ||
| 291 | unsigned int LBA; /* 30 bits */ | ||
| 292 | unsigned short EC; /* 12 bits */ | ||
| 293 | unsigned short Alpha; /* 12 bits */ | ||
| 294 | unsigned short Delta; /* 16 bits */ | ||
| 295 | unsigned short Attribute; /* 16 bits - SiS 7018 */ | ||
| 296 | unsigned short Vol; /* 12 bits (6.6) */ | ||
| 297 | unsigned char Pan; /* 7 bits (1.4.2) */ | ||
| 298 | unsigned char GVSel; /* 1 bit */ | ||
| 299 | unsigned char RVol; /* 7 bits (5.2) */ | ||
| 300 | unsigned char CVol; /* 7 bits (5.2) */ | ||
| 301 | unsigned char FMC; /* 2 bits */ | ||
| 302 | unsigned char CTRL; /* 4 bits */ | ||
| 303 | unsigned char FMS; /* 4 bits */ | ||
| 304 | unsigned char LFO; /* 8 bits */ | ||
| 305 | |||
| 306 | unsigned int negCSO; /* nonzero - use negative CSO */ | ||
| 307 | |||
| 308 | struct snd_util_memblk *memblk; /* memory block if TLB enabled */ | ||
| 309 | |||
| 310 | /* PCM data */ | ||
| 311 | |||
| 312 | struct snd_trident *trident; | ||
| 313 | struct snd_pcm_substream *substream; | ||
| 314 | struct snd_trident_voice *extra; /* extra PCM voice (acts as interrupt generator) */ | ||
| 315 | unsigned int running: 1, | ||
| 316 | capture: 1, | ||
| 317 | spdif: 1, | ||
| 318 | foldback: 1, | ||
| 319 | isync: 1, | ||
| 320 | isync2: 1, | ||
| 321 | isync3: 1; | ||
| 322 | int foldback_chan; /* foldback subdevice number */ | ||
| 323 | unsigned int stimer; /* global sample timer (to detect spurious interrupts) */ | ||
| 324 | unsigned int spurious_threshold; /* spurious threshold */ | ||
| 325 | unsigned int isync_mark; | ||
| 326 | unsigned int isync_max; | ||
| 327 | unsigned int isync_ESO; | ||
| 328 | |||
| 329 | /* --- */ | ||
| 330 | |||
| 331 | void *private_data; | ||
| 332 | void (*private_free)(struct snd_trident_voice *voice); | ||
| 333 | }; | ||
| 334 | |||
| 335 | struct snd_4dwave { | ||
| 336 | int seq_client; | ||
| 337 | |||
| 338 | struct snd_trident_port seq_ports[4]; | ||
| 339 | struct snd_trident_voice voices[64]; | ||
| 340 | |||
| 341 | int ChanSynthCount; /* number of allocated synth channels */ | ||
| 342 | int max_size; /* maximum synth memory size in bytes */ | ||
| 343 | int current_size; /* current allocated synth mem in bytes */ | ||
| 344 | }; | ||
| 345 | |||
| 346 | struct snd_trident_pcm_mixer { | ||
| 347 | struct snd_trident_voice *voice; /* active voice */ | ||
| 348 | unsigned short vol; /* front volume */ | ||
| 349 | unsigned char pan; /* pan control */ | ||
| 350 | unsigned char rvol; /* rear volume */ | ||
| 351 | unsigned char cvol; /* center volume */ | ||
| 352 | unsigned char pad; | ||
| 353 | }; | ||
| 354 | |||
| 355 | struct snd_trident { | ||
| 356 | int irq; | ||
| 357 | |||
| 358 | unsigned int device; /* device ID */ | ||
| 359 | |||
| 360 | unsigned char bDMAStart; | ||
| 361 | |||
| 362 | unsigned long port; | ||
| 363 | unsigned long midi_port; | ||
| 364 | |||
| 365 | unsigned int spurious_irq_count; | ||
| 366 | unsigned int spurious_irq_max_delta; | ||
| 367 | |||
| 368 | struct snd_trident_tlb tlb; /* TLB entries for NX cards */ | ||
| 369 | |||
| 370 | unsigned char spdif_ctrl; | ||
| 371 | unsigned char spdif_pcm_ctrl; | ||
| 372 | unsigned int spdif_bits; | ||
| 373 | unsigned int spdif_pcm_bits; | ||
| 374 | struct snd_kcontrol *spdif_pcm_ctl; /* S/PDIF settings */ | ||
| 375 | unsigned int ac97_ctrl; | ||
| 376 | |||
| 377 | unsigned int ChanMap[2]; /* allocation map for hardware channels */ | ||
| 378 | |||
| 379 | int ChanPCM; /* max number of PCM channels */ | ||
| 380 | int ChanPCMcnt; /* actual number of PCM channels */ | ||
| 381 | |||
| 382 | unsigned int ac97_detect: 1; /* 1 = AC97 in detection phase */ | ||
| 383 | unsigned int in_suspend: 1; /* 1 during suspend/resume */ | ||
| 384 | |||
| 385 | struct snd_4dwave synth; /* synth specific variables */ | ||
| 386 | |||
| 387 | spinlock_t event_lock; | ||
| 388 | spinlock_t voice_alloc; | ||
| 389 | |||
| 390 | struct snd_dma_device dma_dev; | ||
| 391 | |||
| 392 | struct pci_dev *pci; | ||
| 393 | struct snd_card *card; | ||
| 394 | struct snd_pcm *pcm; /* ADC/DAC PCM */ | ||
| 395 | struct snd_pcm *foldback; /* Foldback PCM */ | ||
| 396 | struct snd_pcm *spdif; /* SPDIF PCM */ | ||
| 397 | struct snd_rawmidi *rmidi; | ||
| 398 | |||
| 399 | struct snd_ac97_bus *ac97_bus; | ||
| 400 | struct snd_ac97 *ac97; | ||
| 401 | struct snd_ac97 *ac97_sec; | ||
| 402 | |||
| 403 | unsigned int musicvol_wavevol; | ||
| 404 | struct snd_trident_pcm_mixer pcm_mixer[32]; | ||
| 405 | struct snd_kcontrol *ctl_vol; /* front volume */ | ||
| 406 | struct snd_kcontrol *ctl_pan; /* pan */ | ||
| 407 | struct snd_kcontrol *ctl_rvol; /* rear volume */ | ||
| 408 | struct snd_kcontrol *ctl_cvol; /* center volume */ | ||
| 409 | |||
| 410 | spinlock_t reg_lock; | ||
| 411 | |||
| 412 | struct gameport *gameport; | ||
| 413 | }; | ||
| 414 | |||
| 415 | int snd_trident_create(struct snd_card *card, | ||
| 416 | struct pci_dev *pci, | ||
| 417 | int pcm_streams, | ||
| 418 | int pcm_spdif_device, | ||
| 419 | int max_wavetable_size, | ||
| 420 | struct snd_trident ** rtrident); | ||
| 421 | int snd_trident_create_gameport(struct snd_trident *trident); | ||
| 422 | |||
| 423 | int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | ||
| 424 | int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | ||
| 425 | int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); | ||
| 426 | int snd_trident_attach_synthesizer(struct snd_trident * trident); | ||
| 427 | struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, | ||
| 428 | int client, int port); | ||
| 429 | void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice); | ||
| 430 | void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice); | ||
| 431 | void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice); | ||
| 432 | void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice); | ||
| 433 | int snd_trident_suspend(struct pci_dev *pci, pm_message_t state); | ||
| 434 | int snd_trident_resume(struct pci_dev *pci); | ||
| 435 | |||
| 436 | /* TLB memory allocation */ | ||
| 437 | struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident, | ||
| 438 | struct snd_pcm_substream *substream); | ||
| 439 | int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk); | ||
| 440 | struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size); | ||
| 441 | int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk); | ||
| 442 | int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk, | ||
| 443 | int offset, const char __user *data, int size); | ||
| 444 | |||
| 445 | #endif /* __SOUND_TRIDENT_H */ | ||
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 5456343ebe4c..4f67c762cd74 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h | |||
| @@ -341,7 +341,7 @@ int vx_change_frequency(struct vx_core *chip); | |||
| 341 | /* | 341 | /* |
| 342 | * PM | 342 | * PM |
| 343 | */ | 343 | */ |
| 344 | int snd_vx_suspend(struct vx_core *card, pm_message_t state); | 344 | int snd_vx_suspend(struct vx_core *card); |
| 345 | int snd_vx_resume(struct vx_core *card); | 345 | int snd_vx_resume(struct vx_core *card); |
| 346 | 346 | ||
| 347 | /* | 347 | /* |
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h deleted file mode 100644 index 41199664666b..000000000000 --- a/include/sound/ymfpci.h +++ /dev/null | |||
| @@ -1,390 +0,0 @@ | |||
| 1 | #ifndef __SOUND_YMFPCI_H | ||
| 2 | #define __SOUND_YMFPCI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> | ||
| 6 | * Definitions for Yahama YMF724/740/744/754 chips | ||
| 7 | * | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License, or | ||
| 12 | * (at your option) any later version. | ||
| 13 | * | ||
| 14 | * This program is distributed in the hope that it will be useful, | ||
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | * GNU General Public License for more details. | ||
| 18 | * | ||
| 19 | * You should have received a copy of the GNU General Public License | ||
| 20 | * along with this program; if not, write to the Free Software | ||
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 22 | * | ||
| 23 | */ | ||
| 24 | |||
| 25 | #include "pcm.h" | ||
| 26 | #include "rawmidi.h" | ||
| 27 | #include "ac97_codec.h" | ||
| 28 | #include "timer.h" | ||
| 29 | #include <linux/gameport.h> | ||
| 30 | |||
| 31 | /* | ||
| 32 | * Direct registers | ||
| 33 | */ | ||
| 34 | |||
| 35 | #define YMFREG(chip, reg) (chip->port + YDSXGR_##reg) | ||
| 36 | |||
| 37 | #define YDSXGR_INTFLAG 0x0004 | ||
| 38 | #define YDSXGR_ACTIVITY 0x0006 | ||
| 39 | #define YDSXGR_GLOBALCTRL 0x0008 | ||
| 40 | #define YDSXGR_ZVCTRL 0x000A | ||
| 41 | #define YDSXGR_TIMERCTRL 0x0010 | ||
| 42 | #define YDSXGR_TIMERCOUNT 0x0012 | ||
| 43 | #define YDSXGR_SPDIFOUTCTRL 0x0018 | ||
| 44 | #define YDSXGR_SPDIFOUTSTATUS 0x001C | ||
| 45 | #define YDSXGR_EEPROMCTRL 0x0020 | ||
| 46 | #define YDSXGR_SPDIFINCTRL 0x0034 | ||
| 47 | #define YDSXGR_SPDIFINSTATUS 0x0038 | ||
| 48 | #define YDSXGR_DSPPROGRAMDL 0x0048 | ||
| 49 | #define YDSXGR_DLCNTRL 0x004C | ||
| 50 | #define YDSXGR_GPIOININTFLAG 0x0050 | ||
| 51 | #define YDSXGR_GPIOININTENABLE 0x0052 | ||
| 52 | #define YDSXGR_GPIOINSTATUS 0x0054 | ||
| 53 | #define YDSXGR_GPIOOUTCTRL 0x0056 | ||
| 54 | #define YDSXGR_GPIOFUNCENABLE 0x0058 | ||
| 55 | #define YDSXGR_GPIOTYPECONFIG 0x005A | ||
| 56 | #define YDSXGR_AC97CMDDATA 0x0060 | ||
| 57 | #define YDSXGR_AC97CMDADR 0x0062 | ||
| 58 | #define YDSXGR_PRISTATUSDATA 0x0064 | ||
| 59 | #define YDSXGR_PRISTATUSADR 0x0066 | ||
| 60 | #define YDSXGR_SECSTATUSDATA 0x0068 | ||
| 61 | #define YDSXGR_SECSTATUSADR 0x006A | ||
| 62 | #define YDSXGR_SECCONFIG 0x0070 | ||
| 63 | #define YDSXGR_LEGACYOUTVOL 0x0080 | ||
| 64 | #define YDSXGR_LEGACYOUTVOLL 0x0080 | ||
| 65 | #define YDSXGR_LEGACYOUTVOLR 0x0082 | ||
| 66 | #define YDSXGR_NATIVEDACOUTVOL 0x0084 | ||
| 67 | #define YDSXGR_NATIVEDACOUTVOLL 0x0084 | ||
| 68 | #define YDSXGR_NATIVEDACOUTVOLR 0x0086 | ||
| 69 | #define YDSXGR_ZVOUTVOL 0x0088 | ||
| 70 | #define YDSXGR_ZVOUTVOLL 0x0088 | ||
| 71 | #define YDSXGR_ZVOUTVOLR 0x008A | ||
| 72 | #define YDSXGR_SECADCOUTVOL 0x008C | ||
| 73 | #define YDSXGR_SECADCOUTVOLL 0x008C | ||
| 74 | #define YDSXGR_SECADCOUTVOLR 0x008E | ||
| 75 | #define YDSXGR_PRIADCOUTVOL 0x0090 | ||
| 76 | #define YDSXGR_PRIADCOUTVOLL 0x0090 | ||
| 77 | #define YDSXGR_PRIADCOUTVOLR 0x0092 | ||
| 78 | #define YDSXGR_LEGACYLOOPVOL 0x0094 | ||
| 79 | #define YDSXGR_LEGACYLOOPVOLL 0x0094 | ||
| 80 | #define YDSXGR_LEGACYLOOPVOLR 0x0096 | ||
| 81 | #define YDSXGR_NATIVEDACLOOPVOL 0x0098 | ||
| 82 | #define YDSXGR_NATIVEDACLOOPVOLL 0x0098 | ||
| 83 | #define YDSXGR_NATIVEDACLOOPVOLR 0x009A | ||
| 84 | #define YDSXGR_ZVLOOPVOL 0x009C | ||
| 85 | #define YDSXGR_ZVLOOPVOLL 0x009E | ||
| 86 | #define YDSXGR_ZVLOOPVOLR 0x009E | ||
| 87 | #define YDSXGR_SECADCLOOPVOL 0x00A0 | ||
| 88 | #define YDSXGR_SECADCLOOPVOLL 0x00A0 | ||
| 89 | #define YDSXGR_SECADCLOOPVOLR 0x00A2 | ||
| 90 | #define YDSXGR_PRIADCLOOPVOL 0x00A4 | ||
| 91 | #define YDSXGR_PRIADCLOOPVOLL 0x00A4 | ||
| 92 | #define YDSXGR_PRIADCLOOPVOLR 0x00A6 | ||
| 93 | #define YDSXGR_NATIVEADCINVOL 0x00A8 | ||
| 94 | #define YDSXGR_NATIVEADCINVOLL 0x00A8 | ||
| 95 | #define YDSXGR_NATIVEADCINVOLR 0x00AA | ||
| 96 | #define YDSXGR_NATIVEDACINVOL 0x00AC | ||
| 97 | #define YDSXGR_NATIVEDACINVOLL 0x00AC | ||
| 98 | #define YDSXGR_NATIVEDACINVOLR 0x00AE | ||
| 99 | #define YDSXGR_BUF441OUTVOL 0x00B0 | ||
| 100 | #define YDSXGR_BUF441OUTVOLL 0x00B0 | ||
| 101 | #define YDSXGR_BUF441OUTVOLR 0x00B2 | ||
| 102 | #define YDSXGR_BUF441LOOPVOL 0x00B4 | ||
| 103 | #define YDSXGR_BUF441LOOPVOLL 0x00B4 | ||
| 104 | #define YDSXGR_BUF441LOOPVOLR 0x00B6 | ||
| 105 | #define YDSXGR_SPDIFOUTVOL 0x00B8 | ||
| 106 | #define YDSXGR_SPDIFOUTVOLL 0x00B8 | ||
| 107 | #define YDSXGR_SPDIFOUTVOLR 0x00BA | ||
| 108 | #define YDSXGR_SPDIFLOOPVOL 0x00BC | ||
| 109 | #define YDSXGR_SPDIFLOOPVOLL 0x00BC | ||
| 110 | #define YDSXGR_SPDIFLOOPVOLR 0x00BE | ||
| 111 | #define YDSXGR_ADCSLOTSR 0x00C0 | ||
| 112 | #define YDSXGR_RECSLOTSR 0x00C4 | ||
| 113 | #define YDSXGR_ADCFORMAT 0x00C8 | ||
| 114 | #define YDSXGR_RECFORMAT 0x00CC | ||
| 115 | #define YDSXGR_P44SLOTSR 0x00D0 | ||
| 116 | #define YDSXGR_STATUS 0x0100 | ||
| 117 | #define YDSXGR_CTRLSELECT 0x0104 | ||
| 118 | #define YDSXGR_MODE 0x0108 | ||
| 119 | #define YDSXGR_SAMPLECOUNT 0x010C | ||
| 120 | #define YDSXGR_NUMOFSAMPLES 0x0110 | ||
| 121 | #define YDSXGR_CONFIG 0x0114 | ||
| 122 | #define YDSXGR_PLAYCTRLSIZE 0x0140 | ||
| 123 | #define YDSXGR_RECCTRLSIZE 0x0144 | ||
| 124 | #define YDSXGR_EFFCTRLSIZE 0x0148 | ||
| 125 | #define YDSXGR_WORKSIZE 0x014C | ||
| 126 | #define YDSXGR_MAPOFREC 0x0150 | ||
| 127 | #define YDSXGR_MAPOFEFFECT 0x0154 | ||
| 128 | #define YDSXGR_PLAYCTRLBASE 0x0158 | ||
| 129 | #define YDSXGR_RECCTRLBASE 0x015C | ||
| 130 | #define YDSXGR_EFFCTRLBASE 0x0160 | ||
| 131 | #define YDSXGR_WORKBASE 0x0164 | ||
| 132 | #define YDSXGR_DSPINSTRAM 0x1000 | ||
| 133 | #define YDSXGR_CTRLINSTRAM 0x4000 | ||
| 134 | |||
| 135 | #define YDSXG_AC97READCMD 0x8000 | ||
| 136 | #define YDSXG_AC97WRITECMD 0x0000 | ||
| 137 | |||
| 138 | #define PCIR_DSXG_LEGACY 0x40 | ||
| 139 | #define PCIR_DSXG_ELEGACY 0x42 | ||
| 140 | #define PCIR_DSXG_CTRL 0x48 | ||
| 141 | #define PCIR_DSXG_PWRCTRL1 0x4a | ||
| 142 | #define PCIR_DSXG_PWRCTRL2 0x4e | ||
| 143 | #define PCIR_DSXG_FMBASE 0x60 | ||
| 144 | #define PCIR_DSXG_SBBASE 0x62 | ||
| 145 | #define PCIR_DSXG_MPU401BASE 0x64 | ||
| 146 | #define PCIR_DSXG_JOYBASE 0x66 | ||
| 147 | |||
| 148 | #define YDSXG_DSPLENGTH 0x0080 | ||
| 149 | #define YDSXG_CTRLLENGTH 0x3000 | ||
| 150 | |||
| 151 | #define YDSXG_DEFAULT_WORK_SIZE 0x0400 | ||
| 152 | |||
| 153 | #define YDSXG_PLAYBACK_VOICES 64 | ||
| 154 | #define YDSXG_CAPTURE_VOICES 2 | ||
| 155 | #define YDSXG_EFFECT_VOICES 5 | ||
| 156 | |||
| 157 | #define YMFPCI_LEGACY_SBEN (1 << 0) /* soundblaster enable */ | ||
| 158 | #define YMFPCI_LEGACY_FMEN (1 << 1) /* OPL3 enable */ | ||
| 159 | #define YMFPCI_LEGACY_JPEN (1 << 2) /* joystick enable */ | ||
| 160 | #define YMFPCI_LEGACY_MEN (1 << 3) /* MPU401 enable */ | ||
| 161 | #define YMFPCI_LEGACY_MIEN (1 << 4) /* MPU RX irq enable */ | ||
| 162 | #define YMFPCI_LEGACY_IOBITS (1 << 5) /* i/o bits range, 0 = 16bit, 1 =10bit */ | ||
| 163 | #define YMFPCI_LEGACY_SDMA (3 << 6) /* SB DMA select */ | ||
| 164 | #define YMFPCI_LEGACY_SBIRQ (7 << 8) /* SB IRQ select */ | ||
| 165 | #define YMFPCI_LEGACY_MPUIRQ (7 << 11) /* MPU IRQ select */ | ||
| 166 | #define YMFPCI_LEGACY_SIEN (1 << 14) /* serialized IRQ */ | ||
| 167 | #define YMFPCI_LEGACY_LAD (1 << 15) /* legacy audio disable */ | ||
| 168 | |||
| 169 | #define YMFPCI_LEGACY2_FMIO (3 << 0) /* OPL3 i/o address (724/740) */ | ||
| 170 | #define YMFPCI_LEGACY2_SBIO (3 << 2) /* SB i/o address (724/740) */ | ||
| 171 | #define YMFPCI_LEGACY2_MPUIO (3 << 4) /* MPU401 i/o address (724/740) */ | ||
| 172 | #define YMFPCI_LEGACY2_JSIO (3 << 6) /* joystick i/o address (724/740) */ | ||
| 173 | #define YMFPCI_LEGACY2_MAIM (1 << 8) /* MPU401 ack intr mask */ | ||
| 174 | #define YMFPCI_LEGACY2_SMOD (3 << 11) /* SB DMA mode */ | ||
| 175 | #define YMFPCI_LEGACY2_SBVER (3 << 13) /* SB version select */ | ||
| 176 | #define YMFPCI_LEGACY2_IMOD (1 << 15) /* legacy IRQ mode */ | ||
| 177 | /* SIEN:IMOD 0:0 = legacy irq, 0:1 = INTA, 1:0 = serialized IRQ */ | ||
| 178 | |||
| 179 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) | ||
| 180 | #define SUPPORT_JOYSTICK | ||
| 181 | #endif | ||
| 182 | |||
| 183 | /* | ||
| 184 | * | ||
| 185 | */ | ||
| 186 | |||
| 187 | struct snd_ymfpci_playback_bank { | ||
| 188 | u32 format; | ||
| 189 | u32 loop_default; | ||
| 190 | u32 base; /* 32-bit address */ | ||
| 191 | u32 loop_start; /* 32-bit offset */ | ||
| 192 | u32 loop_end; /* 32-bit offset */ | ||
| 193 | u32 loop_frac; /* 8-bit fraction - loop_start */ | ||
| 194 | u32 delta_end; /* pitch delta end */ | ||
| 195 | u32 lpfK_end; | ||
| 196 | u32 eg_gain_end; | ||
| 197 | u32 left_gain_end; | ||
| 198 | u32 right_gain_end; | ||
| 199 | u32 eff1_gain_end; | ||
| 200 | u32 eff2_gain_end; | ||
| 201 | u32 eff3_gain_end; | ||
| 202 | u32 lpfQ; | ||
| 203 | u32 status; | ||
| 204 | u32 num_of_frames; | ||
| 205 | u32 loop_count; | ||
| 206 | u32 start; | ||
| 207 | u32 start_frac; | ||
| 208 | u32 delta; | ||
| 209 | u32 lpfK; | ||
| 210 | u32 eg_gain; | ||
| 211 | u32 left_gain; | ||
| 212 | u32 right_gain; | ||
| 213 | u32 eff1_gain; | ||
| 214 | u32 eff2_gain; | ||
| 215 | u32 eff3_gain; | ||
| 216 | u32 lpfD1; | ||
| 217 | u32 lpfD2; | ||
| 218 | }; | ||
| 219 | |||
| 220 | struct snd_ymfpci_capture_bank { | ||
| 221 | u32 base; /* 32-bit address */ | ||
| 222 | u32 loop_end; /* 32-bit offset */ | ||
| 223 | u32 start; /* 32-bit offset */ | ||
| 224 | u32 num_of_loops; /* counter */ | ||
| 225 | }; | ||
| 226 | |||
| 227 | struct snd_ymfpci_effect_bank { | ||
| 228 | u32 base; /* 32-bit address */ | ||
| 229 | u32 loop_end; /* 32-bit offset */ | ||
| 230 | u32 start; /* 32-bit offset */ | ||
| 231 | u32 temp; | ||
| 232 | }; | ||
| 233 | |||
| 234 | struct snd_ymfpci_pcm; | ||
| 235 | struct snd_ymfpci; | ||
| 236 | |||
| 237 | enum snd_ymfpci_voice_type { | ||
| 238 | YMFPCI_PCM, | ||
| 239 | YMFPCI_SYNTH, | ||
| 240 | YMFPCI_MIDI | ||
| 241 | }; | ||
| 242 | |||
| 243 | struct snd_ymfpci_voice { | ||
| 244 | struct snd_ymfpci *chip; | ||
| 245 | int number; | ||
| 246 | unsigned int use: 1, | ||
| 247 | pcm: 1, | ||
| 248 | synth: 1, | ||
| 249 | midi: 1; | ||
| 250 | struct snd_ymfpci_playback_bank *bank; | ||
| 251 | dma_addr_t bank_addr; | ||
| 252 | void (*interrupt)(struct snd_ymfpci *chip, struct snd_ymfpci_voice *voice); | ||
| 253 | struct snd_ymfpci_pcm *ypcm; | ||
| 254 | }; | ||
| 255 | |||
| 256 | enum snd_ymfpci_pcm_type { | ||
| 257 | PLAYBACK_VOICE, | ||
| 258 | CAPTURE_REC, | ||
| 259 | CAPTURE_AC97, | ||
| 260 | EFFECT_DRY_LEFT, | ||
| 261 | EFFECT_DRY_RIGHT, | ||
| 262 | EFFECT_EFF1, | ||
| 263 | EFFECT_EFF2, | ||
| 264 | EFFECT_EFF3 | ||
| 265 | }; | ||
| 266 | |||
| 267 | struct snd_ymfpci_pcm { | ||
| 268 | struct snd_ymfpci *chip; | ||
| 269 | enum snd_ymfpci_pcm_type type; | ||
| 270 | struct snd_pcm_substream *substream; | ||
| 271 | struct snd_ymfpci_voice *voices[2]; /* playback only */ | ||
| 272 | unsigned int running: 1, | ||
| 273 | use_441_slot: 1, | ||
| 274 | output_front: 1, | ||
| 275 | output_rear: 1, | ||
| 276 | swap_rear: 1; | ||
| 277 | unsigned int update_pcm_vol; | ||
| 278 | u32 period_size; /* cached from runtime->period_size */ | ||
| 279 | u32 buffer_size; /* cached from runtime->buffer_size */ | ||
| 280 | u32 period_pos; | ||
| 281 | u32 last_pos; | ||
| 282 | u32 capture_bank_number; | ||
| 283 | u32 shift; | ||
| 284 | }; | ||
| 285 | |||
| 286 | struct snd_ymfpci { | ||
| 287 | int irq; | ||
| 288 | |||
| 289 | unsigned int device_id; /* PCI device ID */ | ||
| 290 | unsigned char rev; /* PCI revision */ | ||
| 291 | unsigned long reg_area_phys; | ||
| 292 | void __iomem *reg_area_virt; | ||
| 293 | struct resource *res_reg_area; | ||
| 294 | struct resource *fm_res; | ||
| 295 | struct resource *mpu_res; | ||
| 296 | |||
| 297 | unsigned short old_legacy_ctrl; | ||
| 298 | #ifdef SUPPORT_JOYSTICK | ||
| 299 | struct gameport *gameport; | ||
| 300 | #endif | ||
| 301 | |||
| 302 | struct snd_dma_buffer work_ptr; | ||
| 303 | |||
| 304 | unsigned int bank_size_playback; | ||
| 305 | unsigned int bank_size_capture; | ||
| 306 | unsigned int bank_size_effect; | ||
| 307 | unsigned int work_size; | ||
| 308 | |||
| 309 | void *bank_base_playback; | ||
| 310 | void *bank_base_capture; | ||
| 311 | void *bank_base_effect; | ||
| 312 | void *work_base; | ||
| 313 | dma_addr_t bank_base_playback_addr; | ||
| 314 | dma_addr_t bank_base_capture_addr; | ||
| 315 | dma_addr_t bank_base_effect_addr; | ||
| 316 | dma_addr_t work_base_addr; | ||
| 317 | struct snd_dma_buffer ac3_tmp_base; | ||
| 318 | |||
| 319 | u32 *ctrl_playback; | ||
| 320 | struct snd_ymfpci_playback_bank *bank_playback[YDSXG_PLAYBACK_VOICES][2]; | ||
| 321 | struct snd_ymfpci_capture_bank *bank_capture[YDSXG_CAPTURE_VOICES][2]; | ||
| 322 | struct snd_ymfpci_effect_bank *bank_effect[YDSXG_EFFECT_VOICES][2]; | ||
| 323 | |||
| 324 | int start_count; | ||
| 325 | |||
| 326 | u32 active_bank; | ||
| 327 | struct snd_ymfpci_voice voices[64]; | ||
| 328 | int src441_used; | ||
| 329 | |||
| 330 | struct snd_ac97_bus *ac97_bus; | ||
| 331 | struct snd_ac97 *ac97; | ||
| 332 | struct snd_rawmidi *rawmidi; | ||
| 333 | struct snd_timer *timer; | ||
| 334 | unsigned int timer_ticks; | ||
| 335 | |||
| 336 | struct pci_dev *pci; | ||
| 337 | struct snd_card *card; | ||
| 338 | struct snd_pcm *pcm; | ||
| 339 | struct snd_pcm *pcm2; | ||
| 340 | struct snd_pcm *pcm_spdif; | ||
| 341 | struct snd_pcm *pcm_4ch; | ||
| 342 | struct snd_pcm_substream *capture_substream[YDSXG_CAPTURE_VOICES]; | ||
| 343 | struct snd_pcm_substream *effect_substream[YDSXG_EFFECT_VOICES]; | ||
| 344 | struct snd_kcontrol *ctl_vol_recsrc; | ||
| 345 | struct snd_kcontrol *ctl_vol_adcrec; | ||
| 346 | struct snd_kcontrol *ctl_vol_spdifrec; | ||
| 347 | unsigned short spdif_bits, spdif_pcm_bits; | ||
| 348 | struct snd_kcontrol *spdif_pcm_ctl; | ||
| 349 | int mode_dup4ch; | ||
| 350 | int rear_opened; | ||
| 351 | int spdif_opened; | ||
| 352 | struct snd_ymfpci_pcm_mixer { | ||
| 353 | u16 left; | ||
| 354 | u16 right; | ||
| 355 | struct snd_kcontrol *ctl; | ||
| 356 | } pcm_mixer[32]; | ||
| 357 | |||
| 358 | spinlock_t reg_lock; | ||
| 359 | spinlock_t voice_lock; | ||
| 360 | wait_queue_head_t interrupt_sleep; | ||
| 361 | atomic_t interrupt_sleep_count; | ||
| 362 | struct snd_info_entry *proc_entry; | ||
| 363 | const struct firmware *dsp_microcode; | ||
| 364 | const struct firmware *controller_microcode; | ||
| 365 | |||
| 366 | #ifdef CONFIG_PM | ||
| 367 | u32 *saved_regs; | ||
| 368 | u32 saved_ydsxgr_mode; | ||
| 369 | u16 saved_dsxg_legacy; | ||
| 370 | u16 saved_dsxg_elegacy; | ||
| 371 | #endif | ||
| 372 | }; | ||
| 373 | |||
| 374 | int snd_ymfpci_create(struct snd_card *card, | ||
| 375 | struct pci_dev *pci, | ||
| 376 | unsigned short old_legacy_ctrl, | ||
| 377 | struct snd_ymfpci ** rcodec); | ||
| 378 | void snd_ymfpci_free_gameport(struct snd_ymfpci *chip); | ||
| 379 | |||
| 380 | int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state); | ||
| 381 | int snd_ymfpci_resume(struct pci_dev *pci); | ||
| 382 | |||
| 383 | int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | ||
| 384 | int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | ||
| 385 | int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | ||
| 386 | int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); | ||
| 387 | int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch); | ||
| 388 | int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); | ||
| 389 | |||
| 390 | #endif /* __SOUND_YMFPCI_H */ | ||
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 46e3cd8e197a..7ef9e759f499 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
| @@ -13,7 +13,8 @@ | |||
| 13 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ | 13 | ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ |
| 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ | 14 | ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ |
| 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ | 15 | ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ |
| 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) | 16 | ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ |
| 17 | ERSN(S390_UCONTROL) | ||
| 17 | 18 | ||
| 18 | TRACE_EVENT(kvm_userspace_exit, | 19 | TRACE_EVENT(kvm_userspace_exit, |
| 19 | TP_PROTO(__u32 reason, int errno), | 20 | TP_PROTO(__u32 reason, int errno), |
| @@ -36,7 +37,7 @@ TRACE_EVENT(kvm_userspace_exit, | |||
| 36 | __entry->errno < 0 ? -__entry->errno : __entry->reason) | 37 | __entry->errno < 0 ? -__entry->errno : __entry->reason) |
| 37 | ); | 38 | ); |
| 38 | 39 | ||
| 39 | #if defined(__KVM_HAVE_IOAPIC) | 40 | #if defined(__KVM_HAVE_IRQ_LINE) |
| 40 | TRACE_EVENT(kvm_set_irq, | 41 | TRACE_EVENT(kvm_set_irq, |
| 41 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | 42 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), |
| 42 | TP_ARGS(gsi, level, irq_source_id), | 43 | TP_ARGS(gsi, level, irq_source_id), |
| @@ -56,7 +57,9 @@ TRACE_EVENT(kvm_set_irq, | |||
| 56 | TP_printk("gsi %u level %d source %d", | 57 | TP_printk("gsi %u level %d source %d", |
| 57 | __entry->gsi, __entry->level, __entry->irq_source_id) | 58 | __entry->gsi, __entry->level, __entry->irq_source_id) |
| 58 | ); | 59 | ); |
| 60 | #endif | ||
| 59 | 61 | ||
| 62 | #if defined(__KVM_HAVE_IOAPIC) | ||
| 60 | #define kvm_deliver_mode \ | 63 | #define kvm_deliver_mode \ |
| 61 | {0x0, "Fixed"}, \ | 64 | {0x0, "Fixed"}, \ |
| 62 | {0x1, "LowPrio"}, \ | 65 | {0x1, "LowPrio"}, \ |
diff --git a/include/xen/events.h b/include/xen/events.h index 04399b28e821..9c641deb65d2 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
| @@ -58,6 +58,8 @@ void notify_remote_via_irq(int irq); | |||
| 58 | 58 | ||
| 59 | void xen_irq_resume(void); | 59 | void xen_irq_resume(void); |
| 60 | 60 | ||
| 61 | void xen_hvm_prepare_kexec(struct shared_info *sip, unsigned long pfn); | ||
| 62 | |||
| 61 | /* Clear an irq's pending state, in preparation for polling on it */ | 63 | /* Clear an irq's pending state, in preparation for polling on it */ |
| 62 | void xen_clear_irq_pending(int irq); | 64 | void xen_clear_irq_pending(int irq); |
| 63 | void xen_set_irq_pending(int irq); | 65 | void xen_set_irq_pending(int irq); |
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h index 7cdfca24eafb..794deb07eb53 100644 --- a/include/xen/interface/io/xs_wire.h +++ b/include/xen/interface/io/xs_wire.h | |||
| @@ -29,7 +29,8 @@ enum xsd_sockmsg_type | |||
| 29 | XS_IS_DOMAIN_INTRODUCED, | 29 | XS_IS_DOMAIN_INTRODUCED, |
| 30 | XS_RESUME, | 30 | XS_RESUME, |
| 31 | XS_SET_TARGET, | 31 | XS_SET_TARGET, |
| 32 | XS_RESTRICT | 32 | XS_RESTRICT, |
| 33 | XS_RESET_WATCHES, | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | #define XS_WRITE_NONE "NONE" | 36 | #define XS_WRITE_NONE "NONE" |
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h index 486653f0dd8f..61fa66160983 100644 --- a/include/xen/interface/platform.h +++ b/include/xen/interface/platform.h | |||
| @@ -314,6 +314,13 @@ struct xenpf_pcpuinfo { | |||
| 314 | }; | 314 | }; |
| 315 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_pcpuinfo); | 315 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_pcpuinfo); |
| 316 | 316 | ||
| 317 | #define XENPF_cpu_online 56 | ||
| 318 | #define XENPF_cpu_offline 57 | ||
| 319 | struct xenpf_cpu_ol { | ||
| 320 | uint32_t cpuid; | ||
| 321 | }; | ||
| 322 | DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); | ||
| 323 | |||
| 317 | struct xen_platform_op { | 324 | struct xen_platform_op { |
| 318 | uint32_t cmd; | 325 | uint32_t cmd; |
| 319 | uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ | 326 | uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ |
| @@ -330,6 +337,7 @@ struct xen_platform_op { | |||
| 330 | struct xenpf_getidletime getidletime; | 337 | struct xenpf_getidletime getidletime; |
| 331 | struct xenpf_set_processor_pminfo set_pminfo; | 338 | struct xenpf_set_processor_pminfo set_pminfo; |
| 332 | struct xenpf_pcpuinfo pcpu_info; | 339 | struct xenpf_pcpuinfo pcpu_info; |
| 340 | struct xenpf_cpu_ol cpu_ol; | ||
| 333 | uint8_t pad[128]; | 341 | uint8_t pad[128]; |
| 334 | } u; | 342 | } u; |
| 335 | }; | 343 | }; |
diff --git a/include/xen/interface/xen-mca.h b/include/xen/interface/xen-mca.h new file mode 100644 index 000000000000..73a4ea714d93 --- /dev/null +++ b/include/xen/interface/xen-mca.h | |||
| @@ -0,0 +1,385 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * arch-x86/mca.h | ||
| 3 | * Guest OS machine check interface to x86 Xen. | ||
| 4 | * | ||
| 5 | * Contributed by Advanced Micro Devices, Inc. | ||
| 6 | * Author: Christoph Egger <Christoph.Egger@amd.com> | ||
| 7 | * | ||
| 8 | * Updated by Intel Corporation | ||
| 9 | * Author: Liu, Jinsong <jinsong.liu@intel.com> | ||
| 10 | * | ||
| 11 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 12 | * of this software and associated documentation files (the "Software"), to | ||
| 13 | * deal in the Software without restriction, including without limitation the | ||
| 14 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| 15 | * sell copies of the Software, and to permit persons to whom the Software is | ||
| 16 | * furnished to do so, subject to the following conditions: | ||
| 17 | * | ||
| 18 | * The above copyright notice and this permission notice shall be included in | ||
| 19 | * all copies or substantial portions of the Software. | ||
| 20 | * | ||
| 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 22 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 23 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 24 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 25 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 26 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 27 | * DEALINGS IN THE SOFTWARE. | ||
| 28 | */ | ||
| 29 | |||
| 30 | #ifndef __XEN_PUBLIC_ARCH_X86_MCA_H__ | ||
| 31 | #define __XEN_PUBLIC_ARCH_X86_MCA_H__ | ||
| 32 | |||
| 33 | /* Hypercall */ | ||
| 34 | #define __HYPERVISOR_mca __HYPERVISOR_arch_0 | ||
| 35 | |||
| 36 | #define XEN_MCA_INTERFACE_VERSION 0x01ecc003 | ||
| 37 | |||
| 38 | /* IN: Dom0 calls hypercall to retrieve nonurgent error log entry */ | ||
| 39 | #define XEN_MC_NONURGENT 0x1 | ||
| 40 | /* IN: Dom0 calls hypercall to retrieve urgent error log entry */ | ||
| 41 | #define XEN_MC_URGENT 0x2 | ||
| 42 | /* IN: Dom0 acknowledges previosly-fetched error log entry */ | ||
| 43 | #define XEN_MC_ACK 0x4 | ||
| 44 | |||
| 45 | /* OUT: All is ok */ | ||
| 46 | #define XEN_MC_OK 0x0 | ||
| 47 | /* OUT: Domain could not fetch data. */ | ||
| 48 | #define XEN_MC_FETCHFAILED 0x1 | ||
| 49 | /* OUT: There was no machine check data to fetch. */ | ||
| 50 | #define XEN_MC_NODATA 0x2 | ||
| 51 | |||
| 52 | #ifndef __ASSEMBLY__ | ||
| 53 | /* vIRQ injected to Dom0 */ | ||
| 54 | #define VIRQ_MCA VIRQ_ARCH_0 | ||
| 55 | |||
| 56 | /* | ||
| 57 | * mc_info entry types | ||
| 58 | * mca machine check info are recorded in mc_info entries. | ||
| 59 | * when fetch mca info, it can use MC_TYPE_... to distinguish | ||
| 60 | * different mca info. | ||
| 61 | */ | ||
| 62 | #define MC_TYPE_GLOBAL 0 | ||
| 63 | #define MC_TYPE_BANK 1 | ||
| 64 | #define MC_TYPE_EXTENDED 2 | ||
| 65 | #define MC_TYPE_RECOVERY 3 | ||
| 66 | |||
| 67 | struct mcinfo_common { | ||
| 68 | uint16_t type; /* structure type */ | ||
| 69 | uint16_t size; /* size of this struct in bytes */ | ||
| 70 | }; | ||
| 71 | |||
| 72 | #define MC_FLAG_CORRECTABLE (1 << 0) | ||
| 73 | #define MC_FLAG_UNCORRECTABLE (1 << 1) | ||
| 74 | #define MC_FLAG_RECOVERABLE (1 << 2) | ||
| 75 | #define MC_FLAG_POLLED (1 << 3) | ||
| 76 | #define MC_FLAG_RESET (1 << 4) | ||
| 77 | #define MC_FLAG_CMCI (1 << 5) | ||
| 78 | #define MC_FLAG_MCE (1 << 6) | ||
| 79 | |||
| 80 | /* contains x86 global mc information */ | ||
| 81 | struct mcinfo_global { | ||
| 82 | struct mcinfo_common common; | ||
| 83 | |||
| 84 | uint16_t mc_domid; /* running domain at the time in error */ | ||
| 85 | uint16_t mc_vcpuid; /* virtual cpu scheduled for mc_domid */ | ||
| 86 | uint32_t mc_socketid; /* physical socket of the physical core */ | ||
| 87 | uint16_t mc_coreid; /* physical impacted core */ | ||
| 88 | uint16_t mc_core_threadid; /* core thread of physical core */ | ||
| 89 | uint32_t mc_apicid; | ||
| 90 | uint32_t mc_flags; | ||
| 91 | uint64_t mc_gstatus; /* global status */ | ||
| 92 | }; | ||
| 93 | |||
| 94 | /* contains x86 bank mc information */ | ||
| 95 | struct mcinfo_bank { | ||
| 96 | struct mcinfo_common common; | ||
| 97 | |||
| 98 | uint16_t mc_bank; /* bank nr */ | ||
| 99 | uint16_t mc_domid; /* domain referenced by mc_addr if valid */ | ||
| 100 | uint64_t mc_status; /* bank status */ | ||
| 101 | uint64_t mc_addr; /* bank address */ | ||
| 102 | uint64_t mc_misc; | ||
| 103 | uint64_t mc_ctrl2; | ||
| 104 | uint64_t mc_tsc; | ||
| 105 | }; | ||
| 106 | |||
| 107 | struct mcinfo_msr { | ||
| 108 | uint64_t reg; /* MSR */ | ||
| 109 | uint64_t value; /* MSR value */ | ||
| 110 | }; | ||
| 111 | |||
| 112 | /* contains mc information from other or additional mc MSRs */ | ||
| 113 | struct mcinfo_extended { | ||
| 114 | struct mcinfo_common common; | ||
| 115 | uint32_t mc_msrs; /* Number of msr with valid values. */ | ||
| 116 | /* | ||
| 117 | * Currently Intel extended MSR (32/64) include all gp registers | ||
| 118 | * and E(R)FLAGS, E(R)IP, E(R)MISC, up to 11/19 of them might be | ||
| 119 | * useful at present. So expand this array to 16/32 to leave room. | ||
| 120 | */ | ||
| 121 | struct mcinfo_msr mc_msr[sizeof(void *) * 4]; | ||
| 122 | }; | ||
| 123 | |||
| 124 | /* Recovery Action flags. Giving recovery result information to DOM0 */ | ||
| 125 | |||
| 126 | /* Xen takes successful recovery action, the error is recovered */ | ||
| 127 | #define REC_ACTION_RECOVERED (0x1 << 0) | ||
| 128 | /* No action is performed by XEN */ | ||
| 129 | #define REC_ACTION_NONE (0x1 << 1) | ||
| 130 | /* It's possible DOM0 might take action ownership in some case */ | ||
| 131 | #define REC_ACTION_NEED_RESET (0x1 << 2) | ||
| 132 | |||
| 133 | /* | ||
| 134 | * Different Recovery Action types, if the action is performed successfully, | ||
| 135 | * REC_ACTION_RECOVERED flag will be returned. | ||
| 136 | */ | ||
| 137 | |||
| 138 | /* Page Offline Action */ | ||
| 139 | #define MC_ACTION_PAGE_OFFLINE (0x1 << 0) | ||
| 140 | /* CPU offline Action */ | ||
| 141 | #define MC_ACTION_CPU_OFFLINE (0x1 << 1) | ||
| 142 | /* L3 cache disable Action */ | ||
| 143 | #define MC_ACTION_CACHE_SHRINK (0x1 << 2) | ||
| 144 | |||
| 145 | /* | ||
| 146 | * Below interface used between XEN/DOM0 for passing XEN's recovery action | ||
| 147 | * information to DOM0. | ||
| 148 | */ | ||
| 149 | struct page_offline_action { | ||
| 150 | /* Params for passing the offlined page number to DOM0 */ | ||
| 151 | uint64_t mfn; | ||
| 152 | uint64_t status; | ||
| 153 | }; | ||
| 154 | |||
| 155 | struct cpu_offline_action { | ||
| 156 | /* Params for passing the identity of the offlined CPU to DOM0 */ | ||
| 157 | uint32_t mc_socketid; | ||
| 158 | uint16_t mc_coreid; | ||
| 159 | uint16_t mc_core_threadid; | ||
| 160 | }; | ||
| 161 | |||
| 162 | #define MAX_UNION_SIZE 16 | ||
| 163 | struct mcinfo_recovery { | ||
| 164 | struct mcinfo_common common; | ||
| 165 | uint16_t mc_bank; /* bank nr */ | ||
| 166 | uint8_t action_flags; | ||
| 167 | uint8_t action_types; | ||
| 168 | union { | ||
| 169 | struct page_offline_action page_retire; | ||
| 170 | struct cpu_offline_action cpu_offline; | ||
| 171 | uint8_t pad[MAX_UNION_SIZE]; | ||
| 172 | } action_info; | ||
| 173 | }; | ||
| 174 | |||
| 175 | |||
| 176 | #define MCINFO_MAXSIZE 768 | ||
| 177 | struct mc_info { | ||
| 178 | /* Number of mcinfo_* entries in mi_data */ | ||
| 179 | uint32_t mi_nentries; | ||
| 180 | uint32_t flags; | ||
| 181 | uint64_t mi_data[(MCINFO_MAXSIZE - 1) / 8]; | ||
| 182 | }; | ||
| 183 | DEFINE_GUEST_HANDLE_STRUCT(mc_info); | ||
| 184 | |||
| 185 | #define __MC_MSR_ARRAYSIZE 8 | ||
| 186 | #define __MC_MSR_MCGCAP 0 | ||
| 187 | #define __MC_NMSRS 1 | ||
| 188 | #define MC_NCAPS 7 | ||
| 189 | struct mcinfo_logical_cpu { | ||
| 190 | uint32_t mc_cpunr; | ||
| 191 | uint32_t mc_chipid; | ||
| 192 | uint16_t mc_coreid; | ||
| 193 | uint16_t mc_threadid; | ||
| 194 | uint32_t mc_apicid; | ||
| 195 | uint32_t mc_clusterid; | ||
| 196 | uint32_t mc_ncores; | ||
| 197 | uint32_t mc_ncores_active; | ||
| 198 | uint32_t mc_nthreads; | ||
| 199 | uint32_t mc_cpuid_level; | ||
| 200 | uint32_t mc_family; | ||
| 201 | uint32_t mc_vendor; | ||
| 202 | uint32_t mc_model; | ||
| 203 | uint32_t mc_step; | ||
| 204 | char mc_vendorid[16]; | ||
| 205 | char mc_brandid[64]; | ||
| 206 | uint32_t mc_cpu_caps[MC_NCAPS]; | ||
| 207 | uint32_t mc_cache_size; | ||
| 208 | uint32_t mc_cache_alignment; | ||
| 209 | uint32_t mc_nmsrvals; | ||
| 210 | struct mcinfo_msr mc_msrvalues[__MC_MSR_ARRAYSIZE]; | ||
| 211 | }; | ||
| 212 | DEFINE_GUEST_HANDLE_STRUCT(mcinfo_logical_cpu); | ||
| 213 | |||
| 214 | /* | ||
| 215 | * Prototype: | ||
| 216 | * uint32_t x86_mcinfo_nentries(struct mc_info *mi); | ||
| 217 | */ | ||
| 218 | #define x86_mcinfo_nentries(_mi) \ | ||
| 219 | ((_mi)->mi_nentries) | ||
| 220 | /* | ||
| 221 | * Prototype: | ||
| 222 | * struct mcinfo_common *x86_mcinfo_first(struct mc_info *mi); | ||
| 223 | */ | ||
| 224 | #define x86_mcinfo_first(_mi) \ | ||
| 225 | ((struct mcinfo_common *)(_mi)->mi_data) | ||
| 226 | /* | ||
| 227 | * Prototype: | ||
| 228 | * struct mcinfo_common *x86_mcinfo_next(struct mcinfo_common *mic); | ||
| 229 | */ | ||
| 230 | #define x86_mcinfo_next(_mic) \ | ||
| 231 | ((struct mcinfo_common *)((uint8_t *)(_mic) + (_mic)->size)) | ||
| 232 | |||
| 233 | /* | ||
| 234 | * Prototype: | ||
| 235 | * void x86_mcinfo_lookup(void *ret, struct mc_info *mi, uint16_t type); | ||
| 236 | */ | ||
| 237 | static inline void x86_mcinfo_lookup(struct mcinfo_common **ret, | ||
| 238 | struct mc_info *mi, uint16_t type) | ||
| 239 | { | ||
| 240 | uint32_t i; | ||
| 241 | struct mcinfo_common *mic; | ||
| 242 | bool found = 0; | ||
| 243 | |||
| 244 | if (!ret || !mi) | ||
| 245 | return; | ||
| 246 | |||
| 247 | mic = x86_mcinfo_first(mi); | ||
| 248 | for (i = 0; i < x86_mcinfo_nentries(mi); i++) { | ||
| 249 | if (mic->type == type) { | ||
| 250 | found = 1; | ||
| 251 | break; | ||
| 252 | } | ||
| 253 | mic = x86_mcinfo_next(mic); | ||
| 254 | } | ||
| 255 | |||
| 256 | *ret = found ? mic : NULL; | ||
| 257 | } | ||
| 258 | |||
| 259 | /* | ||
| 260 | * Fetch machine check data from hypervisor. | ||
| 261 | */ | ||
| 262 | #define XEN_MC_fetch 1 | ||
| 263 | struct xen_mc_fetch { | ||
| 264 | /* | ||
| 265 | * IN: XEN_MC_NONURGENT, XEN_MC_URGENT, | ||
| 266 | * XEN_MC_ACK if ack'king an earlier fetch | ||
| 267 | * OUT: XEN_MC_OK, XEN_MC_FETCHAILED, XEN_MC_NODATA | ||
| 268 | */ | ||
| 269 | uint32_t flags; | ||
| 270 | uint32_t _pad0; | ||
| 271 | /* OUT: id for ack, IN: id we are ack'ing */ | ||
| 272 | uint64_t fetch_id; | ||
| 273 | |||
| 274 | /* OUT variables. */ | ||
| 275 | GUEST_HANDLE(mc_info) data; | ||
| 276 | }; | ||
| 277 | DEFINE_GUEST_HANDLE_STRUCT(xen_mc_fetch); | ||
| 278 | |||
| 279 | |||
| 280 | /* | ||
| 281 | * This tells the hypervisor to notify a DomU about the machine check error | ||
| 282 | */ | ||
| 283 | #define XEN_MC_notifydomain 2 | ||
| 284 | struct xen_mc_notifydomain { | ||
| 285 | /* IN variables */ | ||
| 286 | uint16_t mc_domid; /* The unprivileged domain to notify */ | ||
| 287 | uint16_t mc_vcpuid; /* The vcpu in mc_domid to notify */ | ||
| 288 | |||
| 289 | /* IN/OUT variables */ | ||
| 290 | uint32_t flags; | ||
| 291 | }; | ||
| 292 | DEFINE_GUEST_HANDLE_STRUCT(xen_mc_notifydomain); | ||
| 293 | |||
| 294 | #define XEN_MC_physcpuinfo 3 | ||
| 295 | struct xen_mc_physcpuinfo { | ||
| 296 | /* IN/OUT */ | ||
| 297 | uint32_t ncpus; | ||
| 298 | uint32_t _pad0; | ||
| 299 | /* OUT */ | ||
| 300 | GUEST_HANDLE(mcinfo_logical_cpu) info; | ||
| 301 | }; | ||
| 302 | |||
| 303 | #define XEN_MC_msrinject 4 | ||
| 304 | #define MC_MSRINJ_MAXMSRS 8 | ||
| 305 | struct xen_mc_msrinject { | ||
| 306 | /* IN */ | ||
| 307 | uint32_t mcinj_cpunr; /* target processor id */ | ||
| 308 | uint32_t mcinj_flags; /* see MC_MSRINJ_F_* below */ | ||
| 309 | uint32_t mcinj_count; /* 0 .. count-1 in array are valid */ | ||
| 310 | uint32_t _pad0; | ||
| 311 | struct mcinfo_msr mcinj_msr[MC_MSRINJ_MAXMSRS]; | ||
| 312 | }; | ||
| 313 | |||
| 314 | /* Flags for mcinj_flags above; bits 16-31 are reserved */ | ||
| 315 | #define MC_MSRINJ_F_INTERPOSE 0x1 | ||
| 316 | |||
| 317 | #define XEN_MC_mceinject 5 | ||
| 318 | struct xen_mc_mceinject { | ||
| 319 | unsigned int mceinj_cpunr; /* target processor id */ | ||
| 320 | }; | ||
| 321 | |||
| 322 | struct xen_mc { | ||
| 323 | uint32_t cmd; | ||
| 324 | uint32_t interface_version; /* XEN_MCA_INTERFACE_VERSION */ | ||
| 325 | union { | ||
| 326 | struct xen_mc_fetch mc_fetch; | ||
| 327 | struct xen_mc_notifydomain mc_notifydomain; | ||
| 328 | struct xen_mc_physcpuinfo mc_physcpuinfo; | ||
| 329 | struct xen_mc_msrinject mc_msrinject; | ||
| 330 | struct xen_mc_mceinject mc_mceinject; | ||
| 331 | } u; | ||
| 332 | }; | ||
| 333 | DEFINE_GUEST_HANDLE_STRUCT(xen_mc); | ||
| 334 | |||
| 335 | /* Fields are zero when not available */ | ||
| 336 | struct xen_mce { | ||
| 337 | __u64 status; | ||
| 338 | __u64 misc; | ||
| 339 | __u64 addr; | ||
| 340 | __u64 mcgstatus; | ||
| 341 | __u64 ip; | ||
| 342 | __u64 tsc; /* cpu time stamp counter */ | ||
| 343 | __u64 time; /* wall time_t when error was detected */ | ||
| 344 | __u8 cpuvendor; /* cpu vendor as encoded in system.h */ | ||
| 345 | __u8 inject_flags; /* software inject flags */ | ||
| 346 | __u16 pad; | ||
| 347 | __u32 cpuid; /* CPUID 1 EAX */ | ||
| 348 | __u8 cs; /* code segment */ | ||
| 349 | __u8 bank; /* machine check bank */ | ||
| 350 | __u8 cpu; /* cpu number; obsolete; use extcpu now */ | ||
| 351 | __u8 finished; /* entry is valid */ | ||
| 352 | __u32 extcpu; /* linux cpu number that detected the error */ | ||
| 353 | __u32 socketid; /* CPU socket ID */ | ||
| 354 | __u32 apicid; /* CPU initial apic ID */ | ||
| 355 | __u64 mcgcap; /* MCGCAP MSR: machine check capabilities of CPU */ | ||
| 356 | }; | ||
| 357 | |||
| 358 | /* | ||
| 359 | * This structure contains all data related to the MCE log. Also | ||
| 360 | * carries a signature to make it easier to find from external | ||
| 361 | * debugging tools. Each entry is only valid when its finished flag | ||
| 362 | * is set. | ||
| 363 | */ | ||
| 364 | |||
| 365 | #define XEN_MCE_LOG_LEN 32 | ||
| 366 | |||
| 367 | struct xen_mce_log { | ||
| 368 | char signature[12]; /* "MACHINECHECK" */ | ||
| 369 | unsigned len; /* = XEN_MCE_LOG_LEN */ | ||
| 370 | unsigned next; | ||
| 371 | unsigned flags; | ||
| 372 | unsigned recordlen; /* length of struct xen_mce */ | ||
| 373 | struct xen_mce entry[XEN_MCE_LOG_LEN]; | ||
| 374 | }; | ||
| 375 | |||
| 376 | #define XEN_MCE_OVERFLOW 0 /* bit 0 in flags means overflow */ | ||
| 377 | |||
| 378 | #define XEN_MCE_LOG_SIGNATURE "MACHINECHECK" | ||
| 379 | |||
| 380 | #define MCE_GET_RECORD_LEN _IOR('M', 1, int) | ||
| 381 | #define MCE_GET_LOG_LEN _IOR('M', 2, int) | ||
| 382 | #define MCE_GETCLEAR_FLAGS _IOR('M', 3, int) | ||
| 383 | |||
| 384 | #endif /* __ASSEMBLY__ */ | ||
| 385 | #endif /* __XEN_PUBLIC_ARCH_X86_MCA_H__ */ | ||
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h index a890804945e3..0801468f9abe 100644 --- a/include/xen/interface/xen.h +++ b/include/xen/interface/xen.h | |||
| @@ -80,6 +80,7 @@ | |||
| 80 | #define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */ | 80 | #define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */ |
| 81 | #define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */ | 81 | #define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */ |
| 82 | #define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */ | 82 | #define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */ |
| 83 | #define VIRQ_PCPU_STATE 9 /* (DOM0) PCPU state changed */ | ||
| 83 | 84 | ||
| 84 | /* Architecture-specific VIRQ definitions. */ | 85 | /* Architecture-specific VIRQ definitions. */ |
| 85 | #define VIRQ_ARCH_0 16 | 86 | #define VIRQ_ARCH_0 16 |
