diff options
Diffstat (limited to 'include')
36 files changed, 441 insertions, 188 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ebdfde8fe556..0b1a6cae9de1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -1226,6 +1226,8 @@ struct block_device_operations { | |||
| 1226 | int (*direct_access) (struct block_device *, sector_t, | 1226 | int (*direct_access) (struct block_device *, sector_t, |
| 1227 | void **, unsigned long *); | 1227 | void **, unsigned long *); |
| 1228 | int (*media_changed) (struct gendisk *); | 1228 | int (*media_changed) (struct gendisk *); |
| 1229 | unsigned long long (*set_capacity) (struct gendisk *, | ||
| 1230 | unsigned long long); | ||
| 1229 | int (*revalidate_disk) (struct gendisk *); | 1231 | int (*revalidate_disk) (struct gendisk *); |
| 1230 | int (*getgeo)(struct block_device *, struct hd_geometry *); | 1232 | int (*getgeo)(struct block_device *, struct hd_geometry *); |
| 1231 | struct module *owner; | 1233 | struct module *owner; |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 37bcb50a4d7c..04fb5135b4e1 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -261,6 +261,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
| 261 | # define __section(S) __attribute__ ((__section__(#S))) | 261 | # define __section(S) __attribute__ ((__section__(#S))) |
| 262 | #endif | 262 | #endif |
| 263 | 263 | ||
| 264 | /* Are two types/vars the same type (ignoring qualifiers)? */ | ||
| 265 | #ifndef __same_type | ||
| 266 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | ||
| 267 | #endif | ||
| 268 | |||
| 264 | /* | 269 | /* |
| 265 | * Prevent the compiler from merging or refetching accesses. The compiler | 270 | * Prevent the compiler from merging or refetching accesses. The compiler |
| 266 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 271 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 162e5defe683..d41ed593f79f 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
| @@ -121,6 +121,13 @@ struct fuse_file_lock { | |||
| 121 | #define FUSE_BIG_WRITES (1 << 5) | 121 | #define FUSE_BIG_WRITES (1 << 5) |
| 122 | 122 | ||
| 123 | /** | 123 | /** |
| 124 | * CUSE INIT request/reply flags | ||
| 125 | * | ||
| 126 | * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl | ||
| 127 | */ | ||
| 128 | #define CUSE_UNRESTRICTED_IOCTL (1 << 0) | ||
| 129 | |||
| 130 | /** | ||
| 124 | * Release flags | 131 | * Release flags |
| 125 | */ | 132 | */ |
| 126 | #define FUSE_RELEASE_FLUSH (1 << 0) | 133 | #define FUSE_RELEASE_FLUSH (1 << 0) |
| @@ -210,6 +217,9 @@ enum fuse_opcode { | |||
| 210 | FUSE_DESTROY = 38, | 217 | FUSE_DESTROY = 38, |
| 211 | FUSE_IOCTL = 39, | 218 | FUSE_IOCTL = 39, |
| 212 | FUSE_POLL = 40, | 219 | FUSE_POLL = 40, |
| 220 | |||
| 221 | /* CUSE specific operations */ | ||
| 222 | CUSE_INIT = 4096, | ||
| 213 | }; | 223 | }; |
| 214 | 224 | ||
| 215 | enum fuse_notify_code { | 225 | enum fuse_notify_code { |
| @@ -401,6 +411,27 @@ struct fuse_init_out { | |||
| 401 | __u32 max_write; | 411 | __u32 max_write; |
| 402 | }; | 412 | }; |
| 403 | 413 | ||
| 414 | #define CUSE_INIT_INFO_MAX 4096 | ||
| 415 | |||
| 416 | struct cuse_init_in { | ||
| 417 | __u32 major; | ||
| 418 | __u32 minor; | ||
| 419 | __u32 unused; | ||
| 420 | __u32 flags; | ||
| 421 | }; | ||
| 422 | |||
| 423 | struct cuse_init_out { | ||
| 424 | __u32 major; | ||
| 425 | __u32 minor; | ||
| 426 | __u32 unused; | ||
| 427 | __u32 flags; | ||
| 428 | __u32 max_read; | ||
| 429 | __u32 max_write; | ||
| 430 | __u32 dev_major; /* chardev major */ | ||
| 431 | __u32 dev_minor; /* chardev minor */ | ||
| 432 | __u32 spare[10]; | ||
| 433 | }; | ||
| 434 | |||
| 404 | struct fuse_interrupt_in { | 435 | struct fuse_interrupt_in { |
| 405 | __u64 unique; | 436 | __u64 unique; |
| 406 | }; | 437 | }; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 149fda264c86..7cbd38d363a2 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -114,6 +114,7 @@ struct hd_struct { | |||
| 114 | #define GENHD_FL_UP 16 | 114 | #define GENHD_FL_UP 16 |
| 115 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 115 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
| 116 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 116 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
| 117 | #define GENHD_FL_NATIVE_CAPACITY 128 | ||
| 117 | 118 | ||
| 118 | #define BLK_SCSI_MAX_CMDS (256) | 119 | #define BLK_SCSI_MAX_CMDS (256) |
| 119 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 120 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0bbc15f54536..3760e7c5de02 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -85,6 +85,9 @@ struct vm_area_struct; | |||
| 85 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ | 85 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ |
| 86 | __GFP_NORETRY|__GFP_NOMEMALLOC) | 86 | __GFP_NORETRY|__GFP_NOMEMALLOC) |
| 87 | 87 | ||
| 88 | /* Control slab gfp mask during early boot */ | ||
| 89 | #define SLAB_GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) | ||
| 90 | |||
| 88 | /* Control allocation constraints */ | 91 | /* Control allocation constraints */ |
| 89 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) | 92 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) |
| 90 | 93 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 867cb68d8461..a6c6a2fad7c8 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
| @@ -178,7 +178,7 @@ typedef u8 hwif_chipset_t; | |||
| 178 | /* | 178 | /* |
| 179 | * Structure to hold all information about the location of this port | 179 | * Structure to hold all information about the location of this port |
| 180 | */ | 180 | */ |
| 181 | typedef struct hw_regs_s { | 181 | struct ide_hw { |
| 182 | union { | 182 | union { |
| 183 | struct ide_io_ports io_ports; | 183 | struct ide_io_ports io_ports; |
| 184 | unsigned long io_ports_array[IDE_NR_PORTS]; | 184 | unsigned long io_ports_array[IDE_NR_PORTS]; |
| @@ -186,12 +186,11 @@ typedef struct hw_regs_s { | |||
| 186 | 186 | ||
| 187 | int irq; /* our irq number */ | 187 | int irq; /* our irq number */ |
| 188 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 188 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ |
| 189 | hwif_chipset_t chipset; | ||
| 190 | struct device *dev, *parent; | 189 | struct device *dev, *parent; |
| 191 | unsigned long config; | 190 | unsigned long config; |
| 192 | } hw_regs_t; | 191 | }; |
| 193 | 192 | ||
| 194 | static inline void ide_std_init_ports(hw_regs_t *hw, | 193 | static inline void ide_std_init_ports(struct ide_hw *hw, |
| 195 | unsigned long io_addr, | 194 | unsigned long io_addr, |
| 196 | unsigned long ctl_addr) | 195 | unsigned long ctl_addr) |
| 197 | { | 196 | { |
| @@ -218,21 +217,12 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
| 218 | 217 | ||
| 219 | /* | 218 | /* |
| 220 | * Special Driver Flags | 219 | * Special Driver Flags |
| 221 | * | ||
| 222 | * set_geometry : respecify drive geometry | ||
| 223 | * recalibrate : seek to cyl 0 | ||
| 224 | * set_multmode : set multmode count | ||
| 225 | * reserved : unused | ||
| 226 | */ | 220 | */ |
| 227 | typedef union { | 221 | enum { |
| 228 | unsigned all : 8; | 222 | IDE_SFLAG_SET_GEOMETRY = (1 << 0), |
| 229 | struct { | 223 | IDE_SFLAG_RECALIBRATE = (1 << 1), |
| 230 | unsigned set_geometry : 1; | 224 | IDE_SFLAG_SET_MULTMODE = (1 << 2), |
| 231 | unsigned recalibrate : 1; | 225 | }; |
| 232 | unsigned set_multmode : 1; | ||
| 233 | unsigned reserved : 5; | ||
| 234 | } b; | ||
| 235 | } special_t; | ||
| 236 | 226 | ||
| 237 | /* | 227 | /* |
| 238 | * Status returned from various ide_ functions | 228 | * Status returned from various ide_ functions |
| @@ -391,6 +381,7 @@ struct ide_drive_s; | |||
| 391 | struct ide_disk_ops { | 381 | struct ide_disk_ops { |
| 392 | int (*check)(struct ide_drive_s *, const char *); | 382 | int (*check)(struct ide_drive_s *, const char *); |
| 393 | int (*get_capacity)(struct ide_drive_s *); | 383 | int (*get_capacity)(struct ide_drive_s *); |
| 384 | u64 (*set_capacity)(struct ide_drive_s *, u64); | ||
| 394 | void (*setup)(struct ide_drive_s *); | 385 | void (*setup)(struct ide_drive_s *); |
| 395 | void (*flush)(struct ide_drive_s *); | 386 | void (*flush)(struct ide_drive_s *); |
| 396 | int (*init_media)(struct ide_drive_s *, struct gendisk *); | 387 | int (*init_media)(struct ide_drive_s *, struct gendisk *); |
| @@ -468,6 +459,8 @@ enum { | |||
| 468 | IDE_DFLAG_NICE1 = (1 << 5), | 459 | IDE_DFLAG_NICE1 = (1 << 5), |
| 469 | /* device is physically present */ | 460 | /* device is physically present */ |
| 470 | IDE_DFLAG_PRESENT = (1 << 6), | 461 | IDE_DFLAG_PRESENT = (1 << 6), |
| 462 | /* disable Host Protected Area */ | ||
| 463 | IDE_DFLAG_NOHPA = (1 << 7), | ||
| 471 | /* id read from device (synthetic if not set) */ | 464 | /* id read from device (synthetic if not set) */ |
| 472 | IDE_DFLAG_ID_READ = (1 << 8), | 465 | IDE_DFLAG_ID_READ = (1 << 8), |
| 473 | IDE_DFLAG_NOPROBE = (1 << 9), | 466 | IDE_DFLAG_NOPROBE = (1 << 9), |
| @@ -506,6 +499,7 @@ enum { | |||
| 506 | /* write protect */ | 499 | /* write protect */ |
| 507 | IDE_DFLAG_WP = (1 << 29), | 500 | IDE_DFLAG_WP = (1 << 29), |
| 508 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), | 501 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), |
| 502 | IDE_DFLAG_NIEN_QUIRK = (1 << 31), | ||
| 509 | }; | 503 | }; |
| 510 | 504 | ||
| 511 | struct ide_drive_s { | 505 | struct ide_drive_s { |
| @@ -530,14 +524,13 @@ struct ide_drive_s { | |||
| 530 | unsigned long sleep; /* sleep until this time */ | 524 | unsigned long sleep; /* sleep until this time */ |
| 531 | unsigned long timeout; /* max time to wait for irq */ | 525 | unsigned long timeout; /* max time to wait for irq */ |
| 532 | 526 | ||
| 533 | special_t special; /* special action flags */ | 527 | u8 special_flags; /* special action flags */ |
| 534 | 528 | ||
| 535 | u8 select; /* basic drive/head select reg value */ | 529 | u8 select; /* basic drive/head select reg value */ |
| 536 | u8 retry_pio; /* retrying dma capable host in pio */ | 530 | u8 retry_pio; /* retrying dma capable host in pio */ |
| 537 | u8 waiting_for_dma; /* dma currently in progress */ | 531 | u8 waiting_for_dma; /* dma currently in progress */ |
| 538 | u8 dma; /* atapi dma flag */ | 532 | u8 dma; /* atapi dma flag */ |
| 539 | 533 | ||
| 540 | u8 quirk_list; /* considered quirky, set for a specific host */ | ||
| 541 | u8 init_speed; /* transfer rate set at boot */ | 534 | u8 init_speed; /* transfer rate set at boot */ |
| 542 | u8 current_speed; /* current transfer rate set */ | 535 | u8 current_speed; /* current transfer rate set */ |
| 543 | u8 desired_speed; /* desired transfer rate set */ | 536 | u8 desired_speed; /* desired transfer rate set */ |
| @@ -562,8 +555,7 @@ struct ide_drive_s { | |||
| 562 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ | 555 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ |
| 563 | unsigned int failures; /* current failure count */ | 556 | unsigned int failures; /* current failure count */ |
| 564 | unsigned int max_failures; /* maximum allowed failure count */ | 557 | unsigned int max_failures; /* maximum allowed failure count */ |
| 565 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 558 | u64 probed_capacity;/* initial/native media capacity */ |
| 566 | |||
| 567 | u64 capacity64; /* total number of sectors */ | 559 | u64 capacity64; /* total number of sectors */ |
| 568 | 560 | ||
| 569 | int lun; /* logical unit */ | 561 | int lun; /* logical unit */ |
| @@ -1222,7 +1214,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) | |||
| 1222 | } | 1214 | } |
| 1223 | 1215 | ||
| 1224 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, | 1216 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, |
| 1225 | hw_regs_t *, hw_regs_t **); | 1217 | struct ide_hw *, struct ide_hw **); |
| 1226 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1218 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
| 1227 | 1219 | ||
| 1228 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1220 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
| @@ -1461,16 +1453,18 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | |||
| 1461 | void ide_register_region(struct gendisk *); | 1453 | void ide_register_region(struct gendisk *); |
| 1462 | void ide_unregister_region(struct gendisk *); | 1454 | void ide_unregister_region(struct gendisk *); |
| 1463 | 1455 | ||
| 1456 | void ide_check_nien_quirk_list(ide_drive_t *); | ||
| 1464 | void ide_undecoded_slave(ide_drive_t *); | 1457 | void ide_undecoded_slave(ide_drive_t *); |
| 1465 | 1458 | ||
| 1466 | void ide_port_apply_params(ide_hwif_t *); | 1459 | void ide_port_apply_params(ide_hwif_t *); |
| 1467 | int ide_sysfs_register_port(ide_hwif_t *); | 1460 | int ide_sysfs_register_port(ide_hwif_t *); |
| 1468 | 1461 | ||
| 1469 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); | 1462 | struct ide_host *ide_host_alloc(const struct ide_port_info *, struct ide_hw **, |
| 1463 | unsigned int); | ||
| 1470 | void ide_host_free(struct ide_host *); | 1464 | void ide_host_free(struct ide_host *); |
| 1471 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | 1465 | int ide_host_register(struct ide_host *, const struct ide_port_info *, |
| 1472 | hw_regs_t **); | 1466 | struct ide_hw **); |
| 1473 | int ide_host_add(const struct ide_port_info *, hw_regs_t **, | 1467 | int ide_host_add(const struct ide_port_info *, struct ide_hw **, unsigned int, |
| 1474 | struct ide_host **); | 1468 | struct ide_host **); |
| 1475 | void ide_host_remove(struct ide_host *); | 1469 | void ide_host_remove(struct ide_host *); |
| 1476 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1470 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index cfe4fe1b7132..60e8934d10b5 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -79,6 +79,7 @@ | |||
| 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
| 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
| 81 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 81 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
| 82 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ | ||
| 82 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | 83 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 83 | 84 | ||
| 84 | /* | 85 | /* |
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index 175e63f4a8c0..7bc1440fc473 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
| @@ -30,6 +30,10 @@ struct lguest_data | |||
| 30 | /* Wallclock time set by the Host. */ | 30 | /* Wallclock time set by the Host. */ |
| 31 | struct timespec time; | 31 | struct timespec time; |
| 32 | 32 | ||
| 33 | /* Interrupt pending set by the Host. The Guest should do a hypercall | ||
| 34 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ | ||
| 35 | int irq_pending; | ||
| 36 | |||
| 33 | /* Async hypercall ring. Instead of directly making hypercalls, we can | 37 | /* Async hypercall ring. Instead of directly making hypercalls, we can |
| 34 | * place them in here for processing the next time the Host wants. | 38 | * place them in here for processing the next time the Host wants. |
| 35 | * This batching can be quite efficient. */ | 39 | * This batching can be quite efficient. */ |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index a53407a4165c..bfefbdf7498a 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
| @@ -57,7 +57,8 @@ enum lguest_req | |||
| 57 | LHREQ_INITIALIZE, /* + base, pfnlimit, start */ | 57 | LHREQ_INITIALIZE, /* + base, pfnlimit, start */ |
| 58 | LHREQ_GETDMA, /* No longer used */ | 58 | LHREQ_GETDMA, /* No longer used */ |
| 59 | LHREQ_IRQ, /* + irq */ | 59 | LHREQ_IRQ, /* + irq */ |
| 60 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ | 60 | LHREQ_BREAK, /* No longer used */ |
| 61 | LHREQ_EVENTFD, /* + address, fd. */ | ||
| 61 | }; | 62 | }; |
| 62 | 63 | ||
| 63 | /* The alignment to use between consumer and producer parts of vring. | 64 | /* The alignment to use between consumer and producer parts of vring. |
diff --git a/include/linux/module.h b/include/linux/module.h index a8f2c0aa4c32..a7bc6e7b43a7 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -77,6 +77,7 @@ search_extable(const struct exception_table_entry *first, | |||
| 77 | void sort_extable(struct exception_table_entry *start, | 77 | void sort_extable(struct exception_table_entry *start, |
| 78 | struct exception_table_entry *finish); | 78 | struct exception_table_entry *finish); |
| 79 | void sort_main_extable(void); | 79 | void sort_main_extable(void); |
| 80 | void trim_init_extable(struct module *m); | ||
| 80 | 81 | ||
| 81 | #ifdef MODULE | 82 | #ifdef MODULE |
| 82 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 83 | #define MODULE_GENERIC_TABLE(gtype,name) \ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index a4f0b931846c..6547c3cdbc4c 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
| @@ -36,9 +36,14 @@ typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); | |||
| 36 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ | 36 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ |
| 37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); | 37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); |
| 38 | 38 | ||
| 39 | /* Flag bits for kernel_param.flags */ | ||
| 40 | #define KPARAM_KMALLOCED 1 | ||
| 41 | #define KPARAM_ISBOOL 2 | ||
| 42 | |||
| 39 | struct kernel_param { | 43 | struct kernel_param { |
| 40 | const char *name; | 44 | const char *name; |
| 41 | unsigned int perm; | 45 | u16 perm; |
| 46 | u16 flags; | ||
| 42 | param_set_fn set; | 47 | param_set_fn set; |
| 43 | param_get_fn get; | 48 | param_get_fn get; |
| 44 | union { | 49 | union { |
| @@ -79,7 +84,7 @@ struct kparam_array | |||
| 79 | parameters. perm sets the visibility in sysfs: 000 means it's | 84 | parameters. perm sets the visibility in sysfs: 000 means it's |
| 80 | not there, read bits mean it's readable, write bits mean it's | 85 | not there, read bits mean it's readable, write bits mean it's |
| 81 | writable. */ | 86 | writable. */ |
| 82 | #define __module_param_call(prefix, name, set, get, arg, perm) \ | 87 | #define __module_param_call(prefix, name, set, get, arg, isbool, perm) \ |
| 83 | /* Default value instead of permissions? */ \ | 88 | /* Default value instead of permissions? */ \ |
| 84 | static int __param_perm_check_##name __attribute__((unused)) = \ | 89 | static int __param_perm_check_##name __attribute__((unused)) = \ |
| 85 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ | 90 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ |
| @@ -88,10 +93,13 @@ struct kparam_array | |||
| 88 | static struct kernel_param __moduleparam_const __param_##name \ | 93 | static struct kernel_param __moduleparam_const __param_##name \ |
| 89 | __used \ | 94 | __used \ |
| 90 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ | 95 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ |
| 91 | = { __param_str_##name, perm, set, get, { arg } } | 96 | = { __param_str_##name, perm, isbool ? KPARAM_ISBOOL : 0, \ |
| 97 | set, get, { arg } } | ||
| 92 | 98 | ||
| 93 | #define module_param_call(name, set, get, arg, perm) \ | 99 | #define module_param_call(name, set, get, arg, perm) \ |
| 94 | __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) | 100 | __module_param_call(MODULE_PARAM_PREFIX, \ |
| 101 | name, set, get, arg, \ | ||
| 102 | __same_type(*(arg), bool), perm) | ||
| 95 | 103 | ||
| 96 | /* Helper functions: type is byte, short, ushort, int, uint, long, | 104 | /* Helper functions: type is byte, short, ushort, int, uint, long, |
| 97 | ulong, charp, bool or invbool, or XXX if you define param_get_XXX, | 105 | ulong, charp, bool or invbool, or XXX if you define param_get_XXX, |
| @@ -120,15 +128,16 @@ struct kparam_array | |||
| 120 | #define core_param(name, var, type, perm) \ | 128 | #define core_param(name, var, type, perm) \ |
| 121 | param_check_##type(name, &(var)); \ | 129 | param_check_##type(name, &(var)); \ |
| 122 | __module_param_call("", name, param_set_##type, param_get_##type, \ | 130 | __module_param_call("", name, param_set_##type, param_get_##type, \ |
| 123 | &var, perm) | 131 | &var, __same_type(var, bool), perm) |
| 124 | #endif /* !MODULE */ | 132 | #endif /* !MODULE */ |
| 125 | 133 | ||
| 126 | /* Actually copy string: maxlen param is usually sizeof(string). */ | 134 | /* Actually copy string: maxlen param is usually sizeof(string). */ |
| 127 | #define module_param_string(name, string, len, perm) \ | 135 | #define module_param_string(name, string, len, perm) \ |
| 128 | static const struct kparam_string __param_string_##name \ | 136 | static const struct kparam_string __param_string_##name \ |
| 129 | = { len, string }; \ | 137 | = { len, string }; \ |
| 130 | module_param_call(name, param_set_copystring, param_get_string, \ | 138 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
| 131 | .str = &__param_string_##name, perm); \ | 139 | param_set_copystring, param_get_string, \ |
| 140 | .str = &__param_string_##name, 0, perm); \ | ||
| 132 | __MODULE_PARM_TYPE(name, "string") | 141 | __MODULE_PARM_TYPE(name, "string") |
| 133 | 142 | ||
| 134 | /* Called on module insert or kernel boot */ | 143 | /* Called on module insert or kernel boot */ |
| @@ -186,21 +195,30 @@ extern int param_set_charp(const char *val, struct kernel_param *kp); | |||
| 186 | extern int param_get_charp(char *buffer, struct kernel_param *kp); | 195 | extern int param_get_charp(char *buffer, struct kernel_param *kp); |
| 187 | #define param_check_charp(name, p) __param_check(name, p, char *) | 196 | #define param_check_charp(name, p) __param_check(name, p, char *) |
| 188 | 197 | ||
| 198 | /* For historical reasons "bool" parameters can be (unsigned) "int". */ | ||
| 189 | extern int param_set_bool(const char *val, struct kernel_param *kp); | 199 | extern int param_set_bool(const char *val, struct kernel_param *kp); |
| 190 | extern int param_get_bool(char *buffer, struct kernel_param *kp); | 200 | extern int param_get_bool(char *buffer, struct kernel_param *kp); |
| 191 | #define param_check_bool(name, p) __param_check(name, p, int) | 201 | #define param_check_bool(name, p) \ |
| 202 | static inline void __check_##name(void) \ | ||
| 203 | { \ | ||
| 204 | BUILD_BUG_ON(!__same_type(*(p), bool) && \ | ||
| 205 | !__same_type(*(p), unsigned int) && \ | ||
| 206 | !__same_type(*(p), int)); \ | ||
| 207 | } | ||
| 192 | 208 | ||
| 193 | extern int param_set_invbool(const char *val, struct kernel_param *kp); | 209 | extern int param_set_invbool(const char *val, struct kernel_param *kp); |
| 194 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); | 210 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); |
| 195 | #define param_check_invbool(name, p) __param_check(name, p, int) | 211 | #define param_check_invbool(name, p) __param_check(name, p, bool) |
| 196 | 212 | ||
| 197 | /* Comma-separated array: *nump is set to number they actually specified. */ | 213 | /* Comma-separated array: *nump is set to number they actually specified. */ |
| 198 | #define module_param_array_named(name, array, type, nump, perm) \ | 214 | #define module_param_array_named(name, array, type, nump, perm) \ |
| 199 | static const struct kparam_array __param_arr_##name \ | 215 | static const struct kparam_array __param_arr_##name \ |
| 200 | = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ | 216 | = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ |
| 201 | sizeof(array[0]), array }; \ | 217 | sizeof(array[0]), array }; \ |
| 202 | module_param_call(name, param_array_set, param_array_get, \ | 218 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
| 203 | .arr = &__param_arr_##name, perm); \ | 219 | param_array_set, param_array_get, \ |
| 220 | .arr = &__param_arr_##name, \ | ||
| 221 | __same_type(array[0], bool), perm); \ | ||
| 204 | __MODULE_PARM_TYPE(name, "array of " #type) | 222 | __MODULE_PARM_TYPE(name, "array of " #type) |
| 205 | 223 | ||
| 206 | #define module_param_array(name, type, nump, perm) \ | 224 | #define module_param_array(name, type, nump, perm) \ |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 7339c7bf7331..13f126c89ae8 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
| @@ -18,7 +18,19 @@ struct page_cgroup { | |||
| 18 | }; | 18 | }; |
| 19 | 19 | ||
| 20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); | 20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); |
| 21 | void __init page_cgroup_init(void); | 21 | |
| 22 | #ifdef CONFIG_SPARSEMEM | ||
| 23 | static inline void __init page_cgroup_init_flatmem(void) | ||
| 24 | { | ||
| 25 | } | ||
| 26 | extern void __init page_cgroup_init(void); | ||
| 27 | #else | ||
| 28 | void __init page_cgroup_init_flatmem(void); | ||
| 29 | static inline void __init page_cgroup_init(void) | ||
| 30 | { | ||
| 31 | } | ||
| 32 | #endif | ||
| 33 | |||
| 22 | struct page_cgroup *lookup_page_cgroup(struct page *page); | 34 | struct page_cgroup *lookup_page_cgroup(struct page *page); |
| 23 | 35 | ||
| 24 | enum { | 36 | enum { |
| @@ -87,6 +99,10 @@ static inline void page_cgroup_init(void) | |||
| 87 | { | 99 | { |
| 88 | } | 100 | } |
| 89 | 101 | ||
| 102 | static inline void __init page_cgroup_init_flatmem(void) | ||
| 103 | { | ||
| 104 | } | ||
| 105 | |||
| 90 | #endif | 106 | #endif |
| 91 | 107 | ||
| 92 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d7d1c41a0b17..19f8e6d1a4d2 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1005,6 +1005,7 @@ | |||
| 1005 | #define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 | 1005 | #define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 |
| 1006 | #define PCI_DEVICE_ID_PLX_9030 0x9030 | 1006 | #define PCI_DEVICE_ID_PLX_9030 0x9030 |
| 1007 | #define PCI_DEVICE_ID_PLX_9050 0x9050 | 1007 | #define PCI_DEVICE_ID_PLX_9050 0x9050 |
| 1008 | #define PCI_DEVICE_ID_PLX_9056 0x9056 | ||
| 1008 | #define PCI_DEVICE_ID_PLX_9080 0x9080 | 1009 | #define PCI_DEVICE_ID_PLX_9080 0x9080 |
| 1009 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 | 1010 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 |
| 1010 | 1011 | ||
| @@ -1314,6 +1315,13 @@ | |||
| 1314 | 1315 | ||
| 1315 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ | 1316 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ |
| 1316 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 | 1317 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 |
| 1318 | #define PCI_DEVICE_ID_CREATIVE_20K1 0x0005 | ||
| 1319 | #define PCI_DEVICE_ID_CREATIVE_20K2 0x000b | ||
| 1320 | #define PCI_SUBDEVICE_ID_CREATIVE_SB0760 0x0024 | ||
| 1321 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 | ||
| 1322 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 | ||
| 1323 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 | ||
| 1324 | #define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 | ||
| 1317 | 1325 | ||
| 1318 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ | 1326 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ |
| 1319 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 | 1327 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 |
| @@ -1847,6 +1855,10 @@ | |||
| 1847 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 | 1855 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 |
| 1848 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 | 1856 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 |
| 1849 | 1857 | ||
| 1858 | #define PCI_VENDOR_ID_DIGIGRAM 0x1369 | ||
| 1859 | #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM 0xc001 | ||
| 1860 | #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM 0xc002 | ||
| 1861 | |||
| 1850 | #define PCI_VENDOR_ID_KAWASAKI 0x136b | 1862 | #define PCI_VENDOR_ID_KAWASAKI 0x136b |
| 1851 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 | 1863 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 |
| 1852 | 1864 | ||
diff --git a/include/linux/slab.h b/include/linux/slab.h index 48803064cedf..219b8fb4651d 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -319,4 +319,6 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node) | |||
| 319 | return kmalloc_node(size, flags | __GFP_ZERO, node); | 319 | return kmalloc_node(size, flags | __GFP_ZERO, node); |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | void __init kmem_cache_init_late(void); | ||
| 323 | |||
| 322 | #endif /* _LINUX_SLAB_H */ | 324 | #endif /* _LINUX_SLAB_H */ |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index 0ec00b39d006..bb5368df4be8 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
| @@ -34,4 +34,9 @@ static __always_inline void *__kmalloc(size_t size, gfp_t flags) | |||
| 34 | return kmalloc(size, flags); | 34 | return kmalloc(size, flags); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static inline void kmem_cache_init_late(void) | ||
| 38 | { | ||
| 39 | /* Nothing to do */ | ||
| 40 | } | ||
| 41 | |||
| 37 | #endif /* __LINUX_SLOB_DEF_H */ | 42 | #endif /* __LINUX_SLOB_DEF_H */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index be5d40c43bd2..4dcbc2c71491 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -302,4 +302,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 302 | } | 302 | } |
| 303 | #endif | 303 | #endif |
| 304 | 304 | ||
| 305 | void __init kmem_cache_init_late(void); | ||
| 306 | |||
| 305 | #endif /* _LINUX_SLUB_DEF_H */ | 307 | #endif /* _LINUX_SLUB_DEF_H */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 06005fa9e982..4fca4f5440ba 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -10,14 +10,17 @@ | |||
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * virtqueue - a queue to register buffers for sending or receiving. | 12 | * virtqueue - a queue to register buffers for sending or receiving. |
| 13 | * @list: the chain of virtqueues for this device | ||
| 13 | * @callback: the function to call when buffers are consumed (can be NULL). | 14 | * @callback: the function to call when buffers are consumed (can be NULL). |
| 15 | * @name: the name of this virtqueue (mainly for debugging) | ||
| 14 | * @vdev: the virtio device this queue was created for. | 16 | * @vdev: the virtio device this queue was created for. |
| 15 | * @vq_ops: the operations for this virtqueue (see below). | 17 | * @vq_ops: the operations for this virtqueue (see below). |
| 16 | * @priv: a pointer for the virtqueue implementation to use. | 18 | * @priv: a pointer for the virtqueue implementation to use. |
| 17 | */ | 19 | */ |
| 18 | struct virtqueue | 20 | struct virtqueue { |
| 19 | { | 21 | struct list_head list; |
| 20 | void (*callback)(struct virtqueue *vq); | 22 | void (*callback)(struct virtqueue *vq); |
| 23 | const char *name; | ||
| 21 | struct virtio_device *vdev; | 24 | struct virtio_device *vdev; |
| 22 | struct virtqueue_ops *vq_ops; | 25 | struct virtqueue_ops *vq_ops; |
| 23 | void *priv; | 26 | void *priv; |
| @@ -76,15 +79,16 @@ struct virtqueue_ops { | |||
| 76 | * @dev: underlying device. | 79 | * @dev: underlying device. |
| 77 | * @id: the device type identification (used to match it with a driver). | 80 | * @id: the device type identification (used to match it with a driver). |
| 78 | * @config: the configuration ops for this device. | 81 | * @config: the configuration ops for this device. |
| 82 | * @vqs: the list of virtqueues for this device. | ||
| 79 | * @features: the features supported by both driver and device. | 83 | * @features: the features supported by both driver and device. |
| 80 | * @priv: private pointer for the driver's use. | 84 | * @priv: private pointer for the driver's use. |
| 81 | */ | 85 | */ |
| 82 | struct virtio_device | 86 | struct virtio_device { |
| 83 | { | ||
| 84 | int index; | 87 | int index; |
| 85 | struct device dev; | 88 | struct device dev; |
| 86 | struct virtio_device_id id; | 89 | struct virtio_device_id id; |
| 87 | struct virtio_config_ops *config; | 90 | struct virtio_config_ops *config; |
| 91 | struct list_head vqs; | ||
| 88 | /* Note that this is a Linux set_bit-style bitmap. */ | 92 | /* Note that this is a Linux set_bit-style bitmap. */ |
| 89 | unsigned long features[1]; | 93 | unsigned long features[1]; |
| 90 | void *priv; | 94 | void *priv; |
| @@ -99,8 +103,7 @@ void unregister_virtio_device(struct virtio_device *dev); | |||
| 99 | * @id_table: the ids serviced by this driver. | 103 | * @id_table: the ids serviced by this driver. |
| 100 | * @feature_table: an array of feature numbers supported by this device. | 104 | * @feature_table: an array of feature numbers supported by this device. |
| 101 | * @feature_table_size: number of entries in the feature table array. | 105 | * @feature_table_size: number of entries in the feature table array. |
| 102 | * @probe: the function to call when a device is found. Returns a token for | 106 | * @probe: the function to call when a device is found. Returns 0 or -errno. |
| 103 | * remove, or PTR_ERR(). | ||
| 104 | * @remove: the function when a device is removed. | 107 | * @remove: the function when a device is removed. |
| 105 | * @config_changed: optional function to call when the device configuration | 108 | * @config_changed: optional function to call when the device configuration |
| 106 | * changes; may be called in interrupt context. | 109 | * changes; may be called in interrupt context. |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index bf8ec283b232..99f514575f6a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
| 30 | 30 | ||
| 31 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
| 32 | #include <linux/err.h> | ||
| 32 | #include <linux/virtio.h> | 33 | #include <linux/virtio.h> |
| 33 | 34 | ||
| 34 | /** | 35 | /** |
| @@ -49,15 +50,26 @@ | |||
| 49 | * @set_status: write the status byte | 50 | * @set_status: write the status byte |
| 50 | * vdev: the virtio_device | 51 | * vdev: the virtio_device |
| 51 | * status: the new status byte | 52 | * status: the new status byte |
| 53 | * @request_vqs: request the specified number of virtqueues | ||
| 54 | * vdev: the virtio_device | ||
| 55 | * max_vqs: the max number of virtqueues we want | ||
| 56 | * If supplied, must call before any virtqueues are instantiated. | ||
| 57 | * To modify the max number of virtqueues after request_vqs has been | ||
| 58 | * called, call free_vqs and then request_vqs with a new value. | ||
| 59 | * @free_vqs: cleanup resources allocated by request_vqs | ||
| 60 | * vdev: the virtio_device | ||
| 61 | * If supplied, must call after all virtqueues have been deleted. | ||
| 52 | * @reset: reset the device | 62 | * @reset: reset the device |
| 53 | * vdev: the virtio device | 63 | * vdev: the virtio device |
| 54 | * After this, status and feature negotiation must be done again | 64 | * After this, status and feature negotiation must be done again |
| 55 | * @find_vq: find a virtqueue and instantiate it. | 65 | * @find_vqs: find virtqueues and instantiate them. |
| 56 | * vdev: the virtio_device | 66 | * vdev: the virtio_device |
| 57 | * index: the 0-based virtqueue number in case there's more than one. | 67 | * nvqs: the number of virtqueues to find |
| 58 | * callback: the virqtueue callback | 68 | * vqs: on success, includes new virtqueues |
| 59 | * Returns the new virtqueue or ERR_PTR() (eg. -ENOENT). | 69 | * callbacks: array of callbacks, for each virtqueue |
| 60 | * @del_vq: free a virtqueue found by find_vq(). | 70 | * names: array of virtqueue names (mainly for debugging) |
| 71 | * Returns 0 on success or error status | ||
| 72 | * @del_vqs: free virtqueues found by find_vqs(). | ||
| 61 | * @get_features: get the array of feature bits for this device. | 73 | * @get_features: get the array of feature bits for this device. |
| 62 | * vdev: the virtio_device | 74 | * vdev: the virtio_device |
| 63 | * Returns the first 32 feature bits (all we currently need). | 75 | * Returns the first 32 feature bits (all we currently need). |
| @@ -66,6 +78,7 @@ | |||
| 66 | * This gives the final feature bits for the device: it can change | 78 | * This gives the final feature bits for the device: it can change |
| 67 | * the dev->feature bits if it wants. | 79 | * the dev->feature bits if it wants. |
| 68 | */ | 80 | */ |
| 81 | typedef void vq_callback_t(struct virtqueue *); | ||
| 69 | struct virtio_config_ops | 82 | struct virtio_config_ops |
| 70 | { | 83 | { |
| 71 | void (*get)(struct virtio_device *vdev, unsigned offset, | 84 | void (*get)(struct virtio_device *vdev, unsigned offset, |
| @@ -75,10 +88,11 @@ struct virtio_config_ops | |||
| 75 | u8 (*get_status)(struct virtio_device *vdev); | 88 | u8 (*get_status)(struct virtio_device *vdev); |
| 76 | void (*set_status)(struct virtio_device *vdev, u8 status); | 89 | void (*set_status)(struct virtio_device *vdev, u8 status); |
| 77 | void (*reset)(struct virtio_device *vdev); | 90 | void (*reset)(struct virtio_device *vdev); |
| 78 | struct virtqueue *(*find_vq)(struct virtio_device *vdev, | 91 | int (*find_vqs)(struct virtio_device *, unsigned nvqs, |
| 79 | unsigned index, | 92 | struct virtqueue *vqs[], |
| 80 | void (*callback)(struct virtqueue *)); | 93 | vq_callback_t *callbacks[], |
| 81 | void (*del_vq)(struct virtqueue *vq); | 94 | const char *names[]); |
| 95 | void (*del_vqs)(struct virtio_device *); | ||
| 82 | u32 (*get_features)(struct virtio_device *vdev); | 96 | u32 (*get_features)(struct virtio_device *vdev); |
| 83 | void (*finalize_features)(struct virtio_device *vdev); | 97 | void (*finalize_features)(struct virtio_device *vdev); |
| 84 | }; | 98 | }; |
| @@ -99,7 +113,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
| 99 | if (__builtin_constant_p(fbit)) | 113 | if (__builtin_constant_p(fbit)) |
| 100 | BUILD_BUG_ON(fbit >= 32); | 114 | BUILD_BUG_ON(fbit >= 32); |
| 101 | 115 | ||
| 102 | virtio_check_driver_offered_feature(vdev, fbit); | 116 | if (fbit < VIRTIO_TRANSPORT_F_START) |
| 117 | virtio_check_driver_offered_feature(vdev, fbit); | ||
| 118 | |||
| 103 | return test_bit(fbit, vdev->features); | 119 | return test_bit(fbit, vdev->features); |
| 104 | } | 120 | } |
| 105 | 121 | ||
| @@ -126,5 +142,18 @@ static inline int virtio_config_buf(struct virtio_device *vdev, | |||
| 126 | vdev->config->get(vdev, offset, buf, len); | 142 | vdev->config->get(vdev, offset, buf, len); |
| 127 | return 0; | 143 | return 0; |
| 128 | } | 144 | } |
| 145 | |||
| 146 | static inline | ||
| 147 | struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev, | ||
| 148 | vq_callback_t *c, const char *n) | ||
| 149 | { | ||
| 150 | vq_callback_t *callbacks[] = { c }; | ||
| 151 | const char *names[] = { n }; | ||
| 152 | struct virtqueue *vq; | ||
| 153 | int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names); | ||
| 154 | if (err < 0) | ||
| 155 | return ERR_PTR(err); | ||
| 156 | return vq; | ||
| 157 | } | ||
| 129 | #endif /* __KERNEL__ */ | 158 | #endif /* __KERNEL__ */ |
| 130 | #endif /* _LINUX_VIRTIO_CONFIG_H */ | 159 | #endif /* _LINUX_VIRTIO_CONFIG_H */ |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index cd0fd5d181a6..9a3d7c48c622 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
| @@ -47,9 +47,17 @@ | |||
| 47 | /* The bit of the ISR which indicates a device configuration change. */ | 47 | /* The bit of the ISR which indicates a device configuration change. */ |
| 48 | #define VIRTIO_PCI_ISR_CONFIG 0x2 | 48 | #define VIRTIO_PCI_ISR_CONFIG 0x2 |
| 49 | 49 | ||
| 50 | /* MSI-X registers: only enabled if MSI-X is enabled. */ | ||
| 51 | /* A 16-bit vector for configuration changes. */ | ||
| 52 | #define VIRTIO_MSI_CONFIG_VECTOR 20 | ||
| 53 | /* A 16-bit vector for selected queue notifications. */ | ||
| 54 | #define VIRTIO_MSI_QUEUE_VECTOR 22 | ||
| 55 | /* Vector value used to disable MSI for queue */ | ||
| 56 | #define VIRTIO_MSI_NO_VECTOR 0xffff | ||
| 57 | |||
| 50 | /* The remaining space is defined by each driver as the per-driver | 58 | /* The remaining space is defined by each driver as the per-driver |
| 51 | * configuration space */ | 59 | * configuration space */ |
| 52 | #define VIRTIO_PCI_CONFIG 20 | 60 | #define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20) |
| 53 | 61 | ||
| 54 | /* Virtio ABI version, this must match exactly */ | 62 | /* Virtio ABI version, this must match exactly */ |
| 55 | #define VIRTIO_PCI_ABI_VERSION 0 | 63 | #define VIRTIO_PCI_ABI_VERSION 0 |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 71e03722fb59..693e0ec5afa6 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #define VRING_DESC_F_NEXT 1 | 14 | #define VRING_DESC_F_NEXT 1 |
| 15 | /* This marks a buffer as write-only (otherwise read-only). */ | 15 | /* This marks a buffer as write-only (otherwise read-only). */ |
| 16 | #define VRING_DESC_F_WRITE 2 | 16 | #define VRING_DESC_F_WRITE 2 |
| 17 | /* This means the buffer contains a list of buffer descriptors. */ | ||
| 18 | #define VRING_DESC_F_INDIRECT 4 | ||
| 17 | 19 | ||
| 18 | /* The Host uses this in used->flags to advise the Guest: don't kick me when | 20 | /* The Host uses this in used->flags to advise the Guest: don't kick me when |
| 19 | * you add a buffer. It's unreliable, so it's simply an optimization. Guest | 21 | * you add a buffer. It's unreliable, so it's simply an optimization. Guest |
| @@ -24,6 +26,9 @@ | |||
| 24 | * optimization. */ | 26 | * optimization. */ |
| 25 | #define VRING_AVAIL_F_NO_INTERRUPT 1 | 27 | #define VRING_AVAIL_F_NO_INTERRUPT 1 |
| 26 | 28 | ||
| 29 | /* We support indirect buffer descriptors */ | ||
| 30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 | ||
| 31 | |||
| 27 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ | 32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ |
| 28 | struct vring_desc | 33 | struct vring_desc |
| 29 | { | 34 | { |
| @@ -119,7 +124,8 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
| 119 | struct virtio_device *vdev, | 124 | struct virtio_device *vdev, |
| 120 | void *pages, | 125 | void *pages, |
| 121 | void (*notify)(struct virtqueue *vq), | 126 | void (*notify)(struct virtqueue *vq), |
| 122 | void (*callback)(struct virtqueue *vq)); | 127 | void (*callback)(struct virtqueue *vq), |
| 128 | const char *name); | ||
| 123 | void vring_del_virtqueue(struct virtqueue *vq); | 129 | void vring_del_virtqueue(struct virtqueue *vq); |
| 124 | /* Filter out transport-specific feature bits. */ | 130 | /* Filter out transport-specific feature bits. */ |
| 125 | void vring_transport_features(struct virtio_device *vdev); | 131 | void vring_transport_features(struct virtio_device *vdev); |
diff --git a/include/scsi/fc/fc_fip.h b/include/scsi/fc/fc_fip.h index 0627a9ae6347..3d138c1fcf8a 100644 --- a/include/scsi/fc/fc_fip.h +++ b/include/scsi/fc/fc_fip.h | |||
| @@ -22,13 +22,6 @@ | |||
| 22 | * http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf | 22 | * http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf |
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | /* | ||
| 26 | * The FIP ethertype eventually goes in net/if_ether.h. | ||
| 27 | */ | ||
| 28 | #ifndef ETH_P_FIP | ||
| 29 | #define ETH_P_FIP 0x8914 /* FIP Ethertype */ | ||
| 30 | #endif | ||
| 31 | |||
| 32 | #define FIP_DEF_PRI 128 /* default selection priority */ | 25 | #define FIP_DEF_PRI 128 /* default selection priority */ |
| 33 | #define FIP_DEF_FC_MAP 0x0efc00 /* default FCoE MAP (MAC OUI) value */ | 26 | #define FIP_DEF_FC_MAP 0x0efc00 /* default FCoE MAP (MAC OUI) value */ |
| 34 | #define FIP_DEF_FKA 8000 /* default FCF keep-alive/advert period (mS) */ | 27 | #define FIP_DEF_FKA 8000 /* default FCF keep-alive/advert period (mS) */ |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d0ed5226f8c4..4426f00da5ff 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -22,6 +22,11 @@ | |||
| 22 | #define ISCSI_IF_H | 22 | #define ISCSI_IF_H |
| 23 | 23 | ||
| 24 | #include <scsi/iscsi_proto.h> | 24 | #include <scsi/iscsi_proto.h> |
| 25 | #include <linux/in.h> | ||
| 26 | #include <linux/in6.h> | ||
| 27 | |||
| 28 | #define ISCSI_NL_GRP_ISCSID 1 | ||
| 29 | #define ISCSI_NL_GRP_UIP 2 | ||
| 25 | 30 | ||
| 26 | #define UEVENT_BASE 10 | 31 | #define UEVENT_BASE 10 |
| 27 | #define KEVENT_BASE 100 | 32 | #define KEVENT_BASE 100 |
| @@ -50,7 +55,10 @@ enum iscsi_uevent_e { | |||
| 50 | ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, | 55 | ISCSI_UEVENT_TGT_DSCVR = UEVENT_BASE + 15, |
| 51 | ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, | 56 | ISCSI_UEVENT_SET_HOST_PARAM = UEVENT_BASE + 16, |
| 52 | ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, | 57 | ISCSI_UEVENT_UNBIND_SESSION = UEVENT_BASE + 17, |
| 53 | ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, | 58 | ISCSI_UEVENT_CREATE_BOUND_SESSION = UEVENT_BASE + 18, |
| 59 | ISCSI_UEVENT_TRANSPORT_EP_CONNECT_THROUGH_HOST = UEVENT_BASE + 19, | ||
| 60 | |||
| 61 | ISCSI_UEVENT_PATH_UPDATE = UEVENT_BASE + 20, | ||
| 54 | 62 | ||
| 55 | /* up events */ | 63 | /* up events */ |
| 56 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, | 64 | ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, |
| @@ -59,6 +67,9 @@ enum iscsi_uevent_e { | |||
| 59 | ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, | 67 | ISCSI_KEVENT_DESTROY_SESSION = KEVENT_BASE + 4, |
| 60 | ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, | 68 | ISCSI_KEVENT_UNBIND_SESSION = KEVENT_BASE + 5, |
| 61 | ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, | 69 | ISCSI_KEVENT_CREATE_SESSION = KEVENT_BASE + 6, |
| 70 | |||
| 71 | ISCSI_KEVENT_PATH_REQ = KEVENT_BASE + 7, | ||
| 72 | ISCSI_KEVENT_IF_DOWN = KEVENT_BASE + 8, | ||
| 62 | }; | 73 | }; |
| 63 | 74 | ||
| 64 | enum iscsi_tgt_dscvr { | 75 | enum iscsi_tgt_dscvr { |
| @@ -131,6 +142,10 @@ struct iscsi_uevent { | |||
| 131 | struct msg_transport_connect { | 142 | struct msg_transport_connect { |
| 132 | uint32_t non_blocking; | 143 | uint32_t non_blocking; |
| 133 | } ep_connect; | 144 | } ep_connect; |
| 145 | struct msg_transport_connect_through_host { | ||
| 146 | uint32_t host_no; | ||
| 147 | uint32_t non_blocking; | ||
| 148 | } ep_connect_through_host; | ||
| 134 | struct msg_transport_poll { | 149 | struct msg_transport_poll { |
| 135 | uint64_t ep_handle; | 150 | uint64_t ep_handle; |
| 136 | uint32_t timeout_ms; | 151 | uint32_t timeout_ms; |
| @@ -154,6 +169,9 @@ struct iscsi_uevent { | |||
| 154 | uint32_t param; /* enum iscsi_host_param */ | 169 | uint32_t param; /* enum iscsi_host_param */ |
| 155 | uint32_t len; | 170 | uint32_t len; |
| 156 | } set_host_param; | 171 | } set_host_param; |
| 172 | struct msg_set_path { | ||
| 173 | uint32_t host_no; | ||
| 174 | } set_path; | ||
| 157 | } u; | 175 | } u; |
| 158 | union { | 176 | union { |
| 159 | /* messages k -> u */ | 177 | /* messages k -> u */ |
| @@ -187,10 +205,39 @@ struct iscsi_uevent { | |||
| 187 | struct msg_transport_connect_ret { | 205 | struct msg_transport_connect_ret { |
| 188 | uint64_t handle; | 206 | uint64_t handle; |
| 189 | } ep_connect_ret; | 207 | } ep_connect_ret; |
| 208 | struct msg_req_path { | ||
| 209 | uint32_t host_no; | ||
| 210 | } req_path; | ||
| 211 | struct msg_notify_if_down { | ||
| 212 | uint32_t host_no; | ||
| 213 | } notify_if_down; | ||
| 190 | } r; | 214 | } r; |
| 191 | } __attribute__ ((aligned (sizeof(uint64_t)))); | 215 | } __attribute__ ((aligned (sizeof(uint64_t)))); |
| 192 | 216 | ||
| 193 | /* | 217 | /* |
| 218 | * To keep the struct iscsi_uevent size the same for userspace code | ||
| 219 | * compatibility, the main structure for ISCSI_UEVENT_PATH_UPDATE and | ||
| 220 | * ISCSI_KEVENT_PATH_REQ is defined separately and comes after the | ||
| 221 | * struct iscsi_uevent in the NETLINK_ISCSI message. | ||
| 222 | */ | ||
| 223 | struct iscsi_path { | ||
| 224 | uint64_t handle; | ||
| 225 | uint8_t mac_addr[6]; | ||
| 226 | uint8_t mac_addr_old[6]; | ||
| 227 | uint32_t ip_addr_len; /* 4 or 16 */ | ||
| 228 | union { | ||
| 229 | struct in_addr v4_addr; | ||
| 230 | struct in6_addr v6_addr; | ||
| 231 | } src; | ||
| 232 | union { | ||
| 233 | struct in_addr v4_addr; | ||
| 234 | struct in6_addr v6_addr; | ||
| 235 | } dst; | ||
| 236 | uint16_t vlan_id; | ||
| 237 | uint16_t pmtu; | ||
| 238 | } __attribute__ ((aligned (sizeof(uint64_t)))); | ||
| 239 | |||
| 240 | /* | ||
| 194 | * Common error codes | 241 | * Common error codes |
| 195 | */ | 242 | */ |
| 196 | enum iscsi_err { | 243 | enum iscsi_err { |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 45f9cc642c46..ebdd9f4cf070 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -679,6 +679,7 @@ struct fc_lport { | |||
| 679 | unsigned int e_d_tov; | 679 | unsigned int e_d_tov; |
| 680 | unsigned int r_a_tov; | 680 | unsigned int r_a_tov; |
| 681 | u8 max_retry_count; | 681 | u8 max_retry_count; |
| 682 | u8 max_rport_retry_count; | ||
| 682 | u16 link_speed; | 683 | u16 link_speed; |
| 683 | u16 link_supported_speeds; | 684 | u16 link_supported_speeds; |
| 684 | u16 lro_xid; /* max xid for fcoe lro */ | 685 | u16 lro_xid; /* max xid for fcoe lro */ |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 0289f5745fb9..196525cd402f 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -82,9 +82,12 @@ enum { | |||
| 82 | 82 | ||
| 83 | 83 | ||
| 84 | enum { | 84 | enum { |
| 85 | ISCSI_TASK_FREE, | ||
| 85 | ISCSI_TASK_COMPLETED, | 86 | ISCSI_TASK_COMPLETED, |
| 86 | ISCSI_TASK_PENDING, | 87 | ISCSI_TASK_PENDING, |
| 87 | ISCSI_TASK_RUNNING, | 88 | ISCSI_TASK_RUNNING, |
| 89 | ISCSI_TASK_ABRT_TMF, /* aborted due to TMF */ | ||
| 90 | ISCSI_TASK_ABRT_SESS_RECOV, /* aborted due to session recovery */ | ||
| 88 | }; | 91 | }; |
| 89 | 92 | ||
| 90 | struct iscsi_r2t_info { | 93 | struct iscsi_r2t_info { |
| @@ -181,9 +184,7 @@ struct iscsi_conn { | |||
| 181 | 184 | ||
| 182 | /* xmit */ | 185 | /* xmit */ |
| 183 | struct list_head mgmtqueue; /* mgmt (control) xmit queue */ | 186 | struct list_head mgmtqueue; /* mgmt (control) xmit queue */ |
| 184 | struct list_head mgmt_run_list; /* list of control tasks */ | 187 | struct list_head cmdqueue; /* data-path cmd queue */ |
| 185 | struct list_head xmitqueue; /* data-path cmd queue */ | ||
| 186 | struct list_head run_list; /* list of cmds in progress */ | ||
| 187 | struct list_head requeue; /* tasks needing another run */ | 188 | struct list_head requeue; /* tasks needing another run */ |
| 188 | struct work_struct xmitwork; /* per-conn. xmit workqueue */ | 189 | struct work_struct xmitwork; /* per-conn. xmit workqueue */ |
| 189 | unsigned long suspend_tx; /* suspend Tx */ | 190 | unsigned long suspend_tx; /* suspend Tx */ |
| @@ -406,6 +407,7 @@ extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, | |||
| 406 | char *, int); | 407 | char *, int); |
| 407 | extern int iscsi_verify_itt(struct iscsi_conn *, itt_t); | 408 | extern int iscsi_verify_itt(struct iscsi_conn *, itt_t); |
| 408 | extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t); | 409 | extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t); |
| 410 | extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); | ||
| 409 | extern void iscsi_requeue_task(struct iscsi_task *task); | 411 | extern void iscsi_requeue_task(struct iscsi_task *task); |
| 410 | extern void iscsi_put_task(struct iscsi_task *task); | 412 | extern void iscsi_put_task(struct iscsi_task *task); |
| 411 | extern void __iscsi_get_task(struct iscsi_task *task); | 413 | extern void __iscsi_get_task(struct iscsi_task *task); |
diff --git a/include/scsi/osd_attributes.h b/include/scsi/osd_attributes.h index f888a6fda073..56e920ade326 100644 --- a/include/scsi/osd_attributes.h +++ b/include/scsi/osd_attributes.h | |||
| @@ -29,6 +29,7 @@ enum { | |||
| 29 | OSD_APAGE_PARTITION_INFORMATION = OSD_APAGE_PARTITION_FIRST + 1, | 29 | OSD_APAGE_PARTITION_INFORMATION = OSD_APAGE_PARTITION_FIRST + 1, |
| 30 | OSD_APAGE_PARTITION_QUOTAS = OSD_APAGE_PARTITION_FIRST + 2, | 30 | OSD_APAGE_PARTITION_QUOTAS = OSD_APAGE_PARTITION_FIRST + 2, |
| 31 | OSD_APAGE_PARTITION_TIMESTAMP = OSD_APAGE_PARTITION_FIRST + 3, | 31 | OSD_APAGE_PARTITION_TIMESTAMP = OSD_APAGE_PARTITION_FIRST + 3, |
| 32 | OSD_APAGE_PARTITION_ATTR_ACCESS = OSD_APAGE_PARTITION_FIRST + 4, | ||
| 32 | OSD_APAGE_PARTITION_SECURITY = OSD_APAGE_PARTITION_FIRST + 5, | 33 | OSD_APAGE_PARTITION_SECURITY = OSD_APAGE_PARTITION_FIRST + 5, |
| 33 | OSD_APAGE_PARTITION_LAST = 0x5FFFFFFF, | 34 | OSD_APAGE_PARTITION_LAST = 0x5FFFFFFF, |
| 34 | 35 | ||
| @@ -51,7 +52,9 @@ enum { | |||
| 51 | OSD_APAGE_RESERVED_TYPE_LAST = 0xEFFFFFFF, | 52 | OSD_APAGE_RESERVED_TYPE_LAST = 0xEFFFFFFF, |
| 52 | 53 | ||
| 53 | OSD_APAGE_COMMON_FIRST = 0xF0000000, | 54 | OSD_APAGE_COMMON_FIRST = 0xF0000000, |
| 54 | OSD_APAGE_COMMON_LAST = 0xFFFFFFFE, | 55 | OSD_APAGE_COMMON_LAST = 0xFFFFFFFD, |
| 56 | |||
| 57 | OSD_APAGE_CURRENT_COMMAND = 0xFFFFFFFE, | ||
| 55 | 58 | ||
| 56 | OSD_APAGE_REQUEST_ALL = 0xFFFFFFFF, | 59 | OSD_APAGE_REQUEST_ALL = 0xFFFFFFFF, |
| 57 | }; | 60 | }; |
| @@ -106,10 +109,30 @@ enum { | |||
| 106 | OSD_ATTR_RI_PRODUCT_REVISION_LEVEL = 0x7, /* 4 */ | 109 | OSD_ATTR_RI_PRODUCT_REVISION_LEVEL = 0x7, /* 4 */ |
| 107 | OSD_ATTR_RI_PRODUCT_SERIAL_NUMBER = 0x8, /* variable */ | 110 | OSD_ATTR_RI_PRODUCT_SERIAL_NUMBER = 0x8, /* variable */ |
| 108 | OSD_ATTR_RI_OSD_NAME = 0x9, /* variable */ | 111 | OSD_ATTR_RI_OSD_NAME = 0x9, /* variable */ |
| 112 | OSD_ATTR_RI_MAX_CDB_CONTINUATION_LEN = 0xA, /* 4 */ | ||
| 109 | OSD_ATTR_RI_TOTAL_CAPACITY = 0x80, /* 8 */ | 113 | OSD_ATTR_RI_TOTAL_CAPACITY = 0x80, /* 8 */ |
| 110 | OSD_ATTR_RI_USED_CAPACITY = 0x81, /* 8 */ | 114 | OSD_ATTR_RI_USED_CAPACITY = 0x81, /* 8 */ |
| 111 | OSD_ATTR_RI_NUMBER_OF_PARTITIONS = 0xC0, /* 8 */ | 115 | OSD_ATTR_RI_NUMBER_OF_PARTITIONS = 0xC0, /* 8 */ |
| 112 | OSD_ATTR_RI_CLOCK = 0x100, /* 6 */ | 116 | OSD_ATTR_RI_CLOCK = 0x100, /* 6 */ |
| 117 | OARI_DEFAULT_ISOLATION_METHOD = 0X110, /* 1 */ | ||
| 118 | OARI_SUPPORTED_ISOLATION_METHODS = 0X111, /* 32 */ | ||
| 119 | |||
| 120 | OARI_DATA_ATOMICITY_GUARANTEE = 0X120, /* 8 */ | ||
| 121 | OARI_DATA_ATOMICITY_ALIGNMENT = 0X121, /* 8 */ | ||
| 122 | OARI_ATTRIBUTES_ATOMICITY_GUARANTEE = 0X122, /* 8 */ | ||
| 123 | OARI_DATA_ATTRIBUTES_ATOMICITY_MULTIPLIER = 0X123, /* 1 */ | ||
| 124 | |||
| 125 | OARI_MAXIMUM_SNAPSHOTS_COUNT = 0X1C1, /* 0 or 4 */ | ||
| 126 | OARI_MAXIMUM_CLONES_COUNT = 0X1C2, /* 0 or 4 */ | ||
| 127 | OARI_MAXIMUM_BRANCH_DEPTH = 0X1CC, /* 0 or 4 */ | ||
| 128 | OARI_SUPPORTED_OBJECT_DUPLICATION_METHOD_FIRST = 0X200, /* 0 or 4 */ | ||
| 129 | OARI_SUPPORTED_OBJECT_DUPLICATION_METHOD_LAST = 0X2ff, /* 0 or 4 */ | ||
| 130 | OARI_SUPPORTED_TIME_OF_DUPLICATION_METHOD_FIRST = 0X300, /* 0 or 4 */ | ||
| 131 | OARI_SUPPORTED_TIME_OF_DUPLICATION_METHOD_LAST = 0X30F, /* 0 or 4 */ | ||
| 132 | OARI_SUPPORT_FOR_DUPLICATED_OBJECT_FREEZING = 0X310, /* 0 or 4 */ | ||
| 133 | OARI_SUPPORT_FOR_SNAPSHOT_REFRESHING = 0X311, /* 0 or 1 */ | ||
| 134 | OARI_SUPPORTED_CDB_CONTINUATION_DESC_TYPE_FIRST = 0X7000001,/* 0 or 4 */ | ||
| 135 | OARI_SUPPORTED_CDB_CONTINUATION_DESC_TYPE_LAST = 0X700FFFF,/* 0 or 4 */ | ||
| 113 | }; | 136 | }; |
| 114 | /* Root_Information_attributes_page does not have a get_page structure */ | 137 | /* Root_Information_attributes_page does not have a get_page structure */ |
| 115 | 138 | ||
| @@ -120,7 +143,15 @@ enum { | |||
| 120 | OSD_ATTR_PI_PARTITION_ID = 0x1, /* 8 */ | 143 | OSD_ATTR_PI_PARTITION_ID = 0x1, /* 8 */ |
| 121 | OSD_ATTR_PI_USERNAME = 0x9, /* variable */ | 144 | OSD_ATTR_PI_USERNAME = 0x9, /* variable */ |
| 122 | OSD_ATTR_PI_USED_CAPACITY = 0x81, /* 8 */ | 145 | OSD_ATTR_PI_USED_CAPACITY = 0x81, /* 8 */ |
| 146 | OSD_ATTR_PI_USED_CAPACITY_INCREMENT = 0x84, /* 0 or 8 */ | ||
| 123 | OSD_ATTR_PI_NUMBER_OF_OBJECTS = 0xC1, /* 8 */ | 147 | OSD_ATTR_PI_NUMBER_OF_OBJECTS = 0xC1, /* 8 */ |
| 148 | |||
| 149 | OSD_ATTR_PI_ACTUAL_DATA_SPACE = 0xD1, /* 0 or 8 */ | ||
| 150 | OSD_ATTR_PI_RESERVED_DATA_SPACE = 0xD2, /* 0 or 8 */ | ||
| 151 | OSD_ATTR_PI_DEFAULT_SNAPSHOT_DUPLICATION_METHOD = 0x200,/* 0 or 4 */ | ||
| 152 | OSD_ATTR_PI_DEFAULT_CLONE_DUPLICATION_METHOD = 0x201,/* 0 or 4 */ | ||
| 153 | OSD_ATTR_PI_DEFAULT_SP_TIME_OF_DUPLICATION = 0x300,/* 0 or 4 */ | ||
| 154 | OSD_ATTR_PI_DEFAULT_CLONE_TIME_OF_DUPLICATION = 0x301,/* 0 or 4 */ | ||
| 124 | }; | 155 | }; |
| 125 | /* Partition Information attributes page does not have a get_page structure */ | 156 | /* Partition Information attributes page does not have a get_page structure */ |
| 126 | 157 | ||
| @@ -131,6 +162,7 @@ enum { | |||
| 131 | OSD_ATTR_CI_PARTITION_ID = 0x1, /* 8 */ | 162 | OSD_ATTR_CI_PARTITION_ID = 0x1, /* 8 */ |
| 132 | OSD_ATTR_CI_COLLECTION_OBJECT_ID = 0x2, /* 8 */ | 163 | OSD_ATTR_CI_COLLECTION_OBJECT_ID = 0x2, /* 8 */ |
| 133 | OSD_ATTR_CI_USERNAME = 0x9, /* variable */ | 164 | OSD_ATTR_CI_USERNAME = 0x9, /* variable */ |
| 165 | OSD_ATTR_CI_COLLECTION_TYPE = 0xA, /* 1 */ | ||
| 134 | OSD_ATTR_CI_USED_CAPACITY = 0x81, /* 8 */ | 166 | OSD_ATTR_CI_USED_CAPACITY = 0x81, /* 8 */ |
| 135 | }; | 167 | }; |
| 136 | /* Collection Information attributes page does not have a get_page structure */ | 168 | /* Collection Information attributes page does not have a get_page structure */ |
| @@ -144,6 +176,8 @@ enum { | |||
| 144 | OSD_ATTR_OI_USERNAME = 0x9, /* variable */ | 176 | OSD_ATTR_OI_USERNAME = 0x9, /* variable */ |
| 145 | OSD_ATTR_OI_USED_CAPACITY = 0x81, /* 8 */ | 177 | OSD_ATTR_OI_USED_CAPACITY = 0x81, /* 8 */ |
| 146 | OSD_ATTR_OI_LOGICAL_LENGTH = 0x82, /* 8 */ | 178 | OSD_ATTR_OI_LOGICAL_LENGTH = 0x82, /* 8 */ |
| 179 | SD_ATTR_OI_ACTUAL_DATA_SPACE = 0XD1, /* 0 OR 8 */ | ||
| 180 | SD_ATTR_OI_RESERVED_DATA_SPACE = 0XD2, /* 0 OR 8 */ | ||
| 147 | }; | 181 | }; |
| 148 | /* Object Information attributes page does not have a get_page structure */ | 182 | /* Object Information attributes page does not have a get_page structure */ |
| 149 | 183 | ||
| @@ -248,7 +282,18 @@ struct object_timestamps_attributes_page { | |||
| 248 | struct osd_timestamp data_modified_time; | 282 | struct osd_timestamp data_modified_time; |
| 249 | } __packed; | 283 | } __packed; |
| 250 | 284 | ||
| 251 | /* 7.1.2.19 Collections attributes page */ | 285 | /* OSD2r05: 7.1.3.19 Attributes Access attributes page |
| 286 | * (OSD_APAGE_PARTITION_ATTR_ACCESS) | ||
| 287 | * | ||
| 288 | * each attribute is of the form below. Total array length is deduced | ||
| 289 | * from the attribute's length | ||
| 290 | * (See allowed_attributes_access of the struct osd_cap_object_descriptor) | ||
| 291 | */ | ||
| 292 | struct attributes_access_attr { | ||
| 293 | struct osd_attributes_list_attrid attr_list[0]; | ||
| 294 | } __packed; | ||
| 295 | |||
| 296 | /* OSD2r05: 7.1.2.21 Collections attributes page */ | ||
| 252 | /* TBD */ | 297 | /* TBD */ |
| 253 | 298 | ||
| 254 | /* 7.1.2.20 Root Policy/Security attributes page (OSD_APAGE_ROOT_SECURITY) */ | 299 | /* 7.1.2.20 Root Policy/Security attributes page (OSD_APAGE_ROOT_SECURITY) */ |
| @@ -324,4 +369,29 @@ struct object_security_attributes_page { | |||
| 324 | __be32 policy_access_tag; | 369 | __be32 policy_access_tag; |
| 325 | } __packed; | 370 | } __packed; |
| 326 | 371 | ||
| 372 | /* OSD2r05: 7.1.3.31 Current Command attributes page | ||
| 373 | * (OSD_APAGE_CURRENT_COMMAND) | ||
| 374 | */ | ||
| 375 | enum { | ||
| 376 | OSD_ATTR_CC_RESPONSE_INTEGRITY_CHECK_VALUE = 0x1, /* 32 */ | ||
| 377 | OSD_ATTR_CC_OBJECT_TYPE = 0x2, /* 1 */ | ||
| 378 | OSD_ATTR_CC_PARTITION_ID = 0x3, /* 8 */ | ||
| 379 | OSD_ATTR_CC_OBJECT_ID = 0x4, /* 8 */ | ||
| 380 | OSD_ATTR_CC_STARTING_BYTE_ADDRESS_OF_APPEND = 0x5, /* 8 */ | ||
| 381 | OSD_ATTR_CC_CHANGE_IN_USED_CAPACITY = 0x6, /* 8 */ | ||
| 382 | }; | ||
| 383 | |||
| 384 | /*TBD: osdv1_current_command_attributes_page */ | ||
| 385 | |||
| 386 | struct osdv2_current_command_attributes_page { | ||
| 387 | struct osd_attr_page_header hdr; /* id=0xFFFFFFFE, size=0x44 */ | ||
| 388 | u8 response_integrity_check_value[OSD_CRYPTO_KEYID_SIZE]; | ||
| 389 | u8 object_type; | ||
| 390 | u8 reserved[3]; | ||
| 391 | __be64 partition_id; | ||
| 392 | __be64 object_id; | ||
| 393 | __be64 starting_byte_address_of_append; | ||
| 394 | __be64 change_in_used_capacity; | ||
| 395 | }; | ||
| 396 | |||
| 327 | #endif /*ndef __OSD_ATTRIBUTES_H__*/ | 397 | #endif /*ndef __OSD_ATTRIBUTES_H__*/ |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index b24d9616eb46..02bd9f716357 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "osd_types.h" | 18 | #include "osd_types.h" |
| 19 | 19 | ||
| 20 | #include <linux/blkdev.h> | 20 | #include <linux/blkdev.h> |
| 21 | #include <scsi/scsi_device.h> | ||
| 21 | 22 | ||
| 22 | /* Note: "NI" in comments below means "Not Implemented yet" */ | 23 | /* Note: "NI" in comments below means "Not Implemented yet" */ |
| 23 | 24 | ||
| @@ -47,6 +48,7 @@ enum osd_std_version { | |||
| 47 | */ | 48 | */ |
| 48 | struct osd_dev { | 49 | struct osd_dev { |
| 49 | struct scsi_device *scsi_device; | 50 | struct scsi_device *scsi_device; |
| 51 | struct file *file; | ||
| 50 | unsigned def_timeout; | 52 | unsigned def_timeout; |
| 51 | 53 | ||
| 52 | #ifdef OSD_VER1_SUPPORT | 54 | #ifdef OSD_VER1_SUPPORT |
| @@ -69,6 +71,10 @@ void osd_dev_fini(struct osd_dev *od); | |||
| 69 | 71 | ||
| 70 | /* some hi level device operations */ | 72 | /* some hi level device operations */ |
| 71 | int osd_auto_detect_ver(struct osd_dev *od, void *caps); /* GFP_KERNEL */ | 73 | int osd_auto_detect_ver(struct osd_dev *od, void *caps); /* GFP_KERNEL */ |
| 74 | static inline struct request_queue *osd_request_queue(struct osd_dev *od) | ||
| 75 | { | ||
| 76 | return od->scsi_device->request_queue; | ||
| 77 | } | ||
| 72 | 78 | ||
| 73 | /* we might want to use function vector in the future */ | 79 | /* we might want to use function vector in the future */ |
| 74 | static inline void osd_dev_set_ver(struct osd_dev *od, enum osd_std_version v) | 80 | static inline void osd_dev_set_ver(struct osd_dev *od, enum osd_std_version v) |
| @@ -363,7 +369,9 @@ void osd_req_create_object(struct osd_request *or, struct osd_obj_id *); | |||
| 363 | void osd_req_remove_object(struct osd_request *or, struct osd_obj_id *); | 369 | void osd_req_remove_object(struct osd_request *or, struct osd_obj_id *); |
| 364 | 370 | ||
| 365 | void osd_req_write(struct osd_request *or, | 371 | void osd_req_write(struct osd_request *or, |
| 366 | const struct osd_obj_id *, struct bio *data_out, u64 offset); | 372 | const struct osd_obj_id *obj, u64 offset, struct bio *bio, u64 len); |
| 373 | int osd_req_write_kern(struct osd_request *or, | ||
| 374 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); | ||
| 367 | void osd_req_append(struct osd_request *or, | 375 | void osd_req_append(struct osd_request *or, |
| 368 | const struct osd_obj_id *, struct bio *data_out);/* NI */ | 376 | const struct osd_obj_id *, struct bio *data_out);/* NI */ |
| 369 | void osd_req_create_write(struct osd_request *or, | 377 | void osd_req_create_write(struct osd_request *or, |
| @@ -378,7 +386,9 @@ void osd_req_flush_object(struct osd_request *or, | |||
| 378 | /*V2*/ u64 offset, /*V2*/ u64 len); | 386 | /*V2*/ u64 offset, /*V2*/ u64 len); |
| 379 | 387 | ||
| 380 | void osd_req_read(struct osd_request *or, | 388 | void osd_req_read(struct osd_request *or, |
| 381 | const struct osd_obj_id *, struct bio *data_in, u64 offset); | 389 | const struct osd_obj_id *obj, u64 offset, struct bio *bio, u64 len); |
| 390 | int osd_req_read_kern(struct osd_request *or, | ||
| 391 | const struct osd_obj_id *obj, u64 offset, void *buff, u64 len); | ||
| 382 | 392 | ||
| 383 | /* | 393 | /* |
| 384 | * Root/Partition/Collection/Object Attributes commands | 394 | * Root/Partition/Collection/Object Attributes commands |
diff --git a/include/scsi/osd_protocol.h b/include/scsi/osd_protocol.h index 62b2ab8c69d4..2cc8e8b1cc19 100644 --- a/include/scsi/osd_protocol.h +++ b/include/scsi/osd_protocol.h | |||
| @@ -303,7 +303,15 @@ enum osd_service_actions { | |||
| 303 | OSD_ACT_V2(REMOVE_MEMBER_OBJECTS, 0x21) | 303 | OSD_ACT_V2(REMOVE_MEMBER_OBJECTS, 0x21) |
| 304 | OSD_ACT_V2(GET_MEMBER_ATTRIBUTES, 0x22) | 304 | OSD_ACT_V2(GET_MEMBER_ATTRIBUTES, 0x22) |
| 305 | OSD_ACT_V2(SET_MEMBER_ATTRIBUTES, 0x23) | 305 | OSD_ACT_V2(SET_MEMBER_ATTRIBUTES, 0x23) |
| 306 | |||
| 307 | OSD_ACT_V2(CREATE_CLONE, 0x28) | ||
| 308 | OSD_ACT_V2(CREATE_SNAPSHOT, 0x29) | ||
| 309 | OSD_ACT_V2(DETACH_CLONE, 0x2A) | ||
| 310 | OSD_ACT_V2(REFRESH_SNAPSHOT_CLONE, 0x2B) | ||
| 311 | OSD_ACT_V2(RESTORE_PARTITION_FROM_SNAPSHOT, 0x2C) | ||
| 312 | |||
| 306 | OSD_ACT_V2(READ_MAP, 0x31) | 313 | OSD_ACT_V2(READ_MAP, 0x31) |
| 314 | OSD_ACT_V2(READ_MAPS_COMPARE, 0x32) | ||
| 307 | 315 | ||
| 308 | OSD_ACT_V1_V2(PERFORM_SCSI_COMMAND, 0x8F7E, 0x8F7C) | 316 | OSD_ACT_V1_V2(PERFORM_SCSI_COMMAND, 0x8F7E, 0x8F7C) |
| 309 | OSD_ACT_V1_V2(SCSI_TASK_MANAGEMENT, 0x8F7F, 0x8F7D) | 317 | OSD_ACT_V1_V2(SCSI_TASK_MANAGEMENT, 0x8F7F, 0x8F7D) |
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 457588e1119b..349c7f30720d 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h | |||
| @@ -126,12 +126,14 @@ struct iscsi_transport { | |||
| 126 | int *index, int *age); | 126 | int *index, int *age); |
| 127 | 127 | ||
| 128 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); | 128 | void (*session_recovery_timedout) (struct iscsi_cls_session *session); |
| 129 | struct iscsi_endpoint *(*ep_connect) (struct sockaddr *dst_addr, | 129 | struct iscsi_endpoint *(*ep_connect) (struct Scsi_Host *shost, |
| 130 | struct sockaddr *dst_addr, | ||
| 130 | int non_blocking); | 131 | int non_blocking); |
| 131 | int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms); | 132 | int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms); |
| 132 | void (*ep_disconnect) (struct iscsi_endpoint *ep); | 133 | void (*ep_disconnect) (struct iscsi_endpoint *ep); |
| 133 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, | 134 | int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type, |
| 134 | uint32_t enable, struct sockaddr *dst_addr); | 135 | uint32_t enable, struct sockaddr *dst_addr); |
| 136 | int (*set_path) (struct Scsi_Host *shost, struct iscsi_path *params); | ||
| 135 | }; | 137 | }; |
| 136 | 138 | ||
| 137 | /* | 139 | /* |
| @@ -148,6 +150,10 @@ extern void iscsi_conn_error_event(struct iscsi_cls_conn *conn, | |||
| 148 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, | 150 | extern int iscsi_recv_pdu(struct iscsi_cls_conn *conn, struct iscsi_hdr *hdr, |
| 149 | char *data, uint32_t data_size); | 151 | char *data, uint32_t data_size); |
| 150 | 152 | ||
| 153 | extern int iscsi_offload_mesg(struct Scsi_Host *shost, | ||
| 154 | struct iscsi_transport *transport, uint32_t type, | ||
| 155 | char *data, uint16_t data_size); | ||
| 156 | |||
| 151 | struct iscsi_cls_conn { | 157 | struct iscsi_cls_conn { |
| 152 | struct list_head conn_list; /* item in connlist */ | 158 | struct list_head conn_list; /* item in connlist */ |
| 153 | void *dd_data; /* LLD private data */ | 159 | void *dd_data; /* LLD private data */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 6add80fc2512..82aed3f47534 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -255,6 +255,7 @@ typedef int __bitwise snd_pcm_subformat_t; | |||
| 255 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ | 255 | #define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */ |
| 256 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ | 256 | #define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ |
| 257 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ | 257 | #define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ |
| 258 | #define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */ | ||
| 258 | 259 | ||
| 259 | typedef int __bitwise snd_pcm_state_t; | 260 | typedef int __bitwise snd_pcm_state_t; |
| 260 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ | 261 | #define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */ |
diff --git a/include/sound/core.h b/include/sound/core.h index 3dea79829acc..309cb9659a05 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -300,19 +300,10 @@ int snd_card_create(int idx, const char *id, | |||
| 300 | struct module *module, int extra_size, | 300 | struct module *module, int extra_size, |
| 301 | struct snd_card **card_ret); | 301 | struct snd_card **card_ret); |
| 302 | 302 | ||
| 303 | static inline __deprecated | ||
| 304 | struct snd_card *snd_card_new(int idx, const char *id, | ||
| 305 | struct module *module, int extra_size) | ||
| 306 | { | ||
| 307 | struct snd_card *card; | ||
| 308 | if (snd_card_create(idx, id, module, extra_size, &card) < 0) | ||
| 309 | return NULL; | ||
| 310 | return card; | ||
| 311 | } | ||
| 312 | |||
| 313 | int snd_card_disconnect(struct snd_card *card); | 303 | int snd_card_disconnect(struct snd_card *card); |
| 314 | int snd_card_free(struct snd_card *card); | 304 | int snd_card_free(struct snd_card *card); |
| 315 | int snd_card_free_when_closed(struct snd_card *card); | 305 | int snd_card_free_when_closed(struct snd_card *card); |
| 306 | void snd_card_set_id(struct snd_card *card, const char *id); | ||
| 316 | int snd_card_register(struct snd_card *card); | 307 | int snd_card_register(struct snd_card *card); |
| 317 | int snd_card_info_init(void); | 308 | int snd_card_info_init(void); |
| 318 | int snd_card_info_done(void); | 309 | int snd_card_info_done(void); |
diff --git a/include/sound/driver.h b/include/sound/driver.h deleted file mode 100644 index f0359437d01a..000000000000 --- a/include/sound/driver.h +++ /dev/null | |||
| @@ -1 +0,0 @@ | |||
| 1 | #warning "This file is deprecated" | ||
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index c17296891617..23893523dc8c 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -98,6 +98,7 @@ struct snd_pcm_ops { | |||
| 98 | #define SNDRV_PCM_IOCTL1_INFO 1 | 98 | #define SNDRV_PCM_IOCTL1_INFO 1 |
| 99 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 | 99 | #define SNDRV_PCM_IOCTL1_CHANNEL_INFO 2 |
| 100 | #define SNDRV_PCM_IOCTL1_GSTATE 3 | 100 | #define SNDRV_PCM_IOCTL1_GSTATE 3 |
| 101 | #define SNDRV_PCM_IOCTL1_FIFO_SIZE 4 | ||
| 101 | 102 | ||
| 102 | #define SNDRV_PCM_TRIGGER_STOP 0 | 103 | #define SNDRV_PCM_TRIGGER_STOP 0 |
| 103 | #define SNDRV_PCM_TRIGGER_START 1 | 104 | #define SNDRV_PCM_TRIGGER_START 1 |
| @@ -270,6 +271,7 @@ struct snd_pcm_runtime { | |||
| 270 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ | 271 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ |
| 271 | snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ | 272 | snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */ |
| 272 | unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ | 273 | unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ |
| 274 | snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ | ||
| 273 | 275 | ||
| 274 | /* -- HW params -- */ | 276 | /* -- HW params -- */ |
| 275 | snd_pcm_access_t access; /* access mode */ | 277 | snd_pcm_access_t access; /* access mode */ |
| @@ -486,80 +488,6 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream); | |||
| 486 | void snd_pcm_vma_notify_data(void *client, void *data); | 488 | void snd_pcm_vma_notify_data(void *client, void *data); |
| 487 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); | 489 | int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); |
| 488 | 490 | ||
| 489 | #if BITS_PER_LONG >= 64 | ||
| 490 | |||
| 491 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
| 492 | { | ||
| 493 | *rem = *n % div; | ||
| 494 | *n /= div; | ||
| 495 | } | ||
| 496 | |||
| 497 | #elif defined(i386) | ||
| 498 | |||
| 499 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
| 500 | { | ||
| 501 | u_int32_t low, high; | ||
| 502 | low = *n & 0xffffffff; | ||
| 503 | high = *n >> 32; | ||
| 504 | if (high) { | ||
| 505 | u_int32_t high1 = high % div; | ||
| 506 | high /= div; | ||
| 507 | asm("divl %2":"=a" (low), "=d" (*rem):"rm" (div), "a" (low), "d" (high1)); | ||
| 508 | *n = (u_int64_t)high << 32 | low; | ||
| 509 | } else { | ||
| 510 | *n = low / div; | ||
| 511 | *rem = low % div; | ||
| 512 | } | ||
| 513 | } | ||
| 514 | #else | ||
| 515 | |||
| 516 | static inline void divl(u_int32_t high, u_int32_t low, | ||
| 517 | u_int32_t div, | ||
| 518 | u_int32_t *q, u_int32_t *r) | ||
| 519 | { | ||
| 520 | u_int64_t n = (u_int64_t)high << 32 | low; | ||
| 521 | u_int64_t d = (u_int64_t)div << 31; | ||
| 522 | u_int32_t q1 = 0; | ||
| 523 | int c = 32; | ||
| 524 | while (n > 0xffffffffU) { | ||
| 525 | q1 <<= 1; | ||
| 526 | if (n >= d) { | ||
| 527 | n -= d; | ||
| 528 | q1 |= 1; | ||
| 529 | } | ||
| 530 | d >>= 1; | ||
| 531 | c--; | ||
| 532 | } | ||
| 533 | q1 <<= c; | ||
| 534 | if (n) { | ||
| 535 | low = n; | ||
| 536 | *q = q1 | (low / div); | ||
| 537 | *r = low % div; | ||
| 538 | } else { | ||
| 539 | *r = 0; | ||
| 540 | *q = q1; | ||
| 541 | } | ||
| 542 | return; | ||
| 543 | } | ||
| 544 | |||
| 545 | static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem) | ||
| 546 | { | ||
| 547 | u_int32_t low, high; | ||
| 548 | low = *n & 0xffffffff; | ||
| 549 | high = *n >> 32; | ||
| 550 | if (high) { | ||
| 551 | u_int32_t high1 = high % div; | ||
| 552 | u_int32_t low1 = low; | ||
| 553 | high /= div; | ||
| 554 | divl(high1, low1, div, &low, rem); | ||
| 555 | *n = (u_int64_t)high << 32 | low; | ||
| 556 | } else { | ||
| 557 | *n = low / div; | ||
| 558 | *rem = low % div; | ||
| 559 | } | ||
| 560 | } | ||
| 561 | #endif | ||
| 562 | |||
| 563 | /* | 491 | /* |
| 564 | * PCM library | 492 | * PCM library |
| 565 | */ | 493 | */ |
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 13676472ddfc..352d7eee9b6d 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -45,24 +45,6 @@ struct snd_pcm_substream; | |||
| 45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ | 45 | #define SND_SOC_DAIFMT_GATED (1 << 4) /* clock is gated */ |
| 46 | 46 | ||
| 47 | /* | 47 | /* |
| 48 | * DAI Left/Right Clocks. | ||
| 49 | * | ||
| 50 | * Specifies whether the DAI can support different samples for similtanious | ||
| 51 | * playback and capture. This usually requires a seperate physical frame | ||
| 52 | * clock for playback and capture. | ||
| 53 | */ | ||
| 54 | #define SND_SOC_DAIFMT_SYNC (0 << 5) /* Tx FRM = Rx FRM */ | ||
| 55 | #define SND_SOC_DAIFMT_ASYNC (1 << 5) /* Tx FRM ~ Rx FRM */ | ||
| 56 | |||
| 57 | /* | ||
| 58 | * TDM | ||
| 59 | * | ||
| 60 | * Time Division Multiplexing. Allows PCM data to be multplexed with other | ||
| 61 | * data on the DAI. | ||
| 62 | */ | ||
| 63 | #define SND_SOC_DAIFMT_TDM (1 << 6) | ||
| 64 | |||
| 65 | /* | ||
| 66 | * DAI hardware signal inversions. | 48 | * DAI hardware signal inversions. |
| 67 | * | 49 | * |
| 68 | * Specifies whether the DAI can also support inverted clocks for the specified | 50 | * Specifies whether the DAI can also support inverted clocks for the specified |
| @@ -96,6 +78,10 @@ struct snd_pcm_substream; | |||
| 96 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
| 97 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
| 98 | 80 | ||
| 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | ||
| 82 | SNDRV_PCM_FMTBIT_S32_LE |\ | ||
| 83 | SNDRV_PCM_FMTBIT_S32_BE) | ||
| 84 | |||
| 99 | struct snd_soc_dai_ops; | 85 | struct snd_soc_dai_ops; |
| 100 | struct snd_soc_dai; | 86 | struct snd_soc_dai; |
| 101 | struct snd_ac97_bus_ops; | 87 | struct snd_ac97_bus_ops; |
| @@ -208,6 +194,7 @@ struct snd_soc_dai { | |||
| 208 | /* DAI capabilities */ | 194 | /* DAI capabilities */ |
| 209 | struct snd_soc_pcm_stream capture; | 195 | struct snd_soc_pcm_stream capture; |
| 210 | struct snd_soc_pcm_stream playback; | 196 | struct snd_soc_pcm_stream playback; |
| 197 | unsigned int symmetric_rates:1; | ||
| 211 | 198 | ||
| 212 | /* DAI runtime info */ | 199 | /* DAI runtime info */ |
| 213 | struct snd_pcm_runtime *runtime; | 200 | struct snd_pcm_runtime *runtime; |
| @@ -219,11 +206,8 @@ struct snd_soc_dai { | |||
| 219 | /* DAI private data */ | 206 | /* DAI private data */ |
| 220 | void *private_data; | 207 | void *private_data; |
| 221 | 208 | ||
| 222 | /* parent codec/platform */ | 209 | /* parent platform */ |
| 223 | union { | 210 | struct snd_soc_platform *platform; |
| 224 | struct snd_soc_codec *codec; | ||
| 225 | struct snd_soc_platform *platform; | ||
| 226 | }; | ||
| 227 | 211 | ||
| 228 | struct list_head list; | 212 | struct list_head list; |
| 229 | }; | 213 | }; |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index a7def6a9a030..ec8a45f9a069 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -140,16 +140,30 @@ | |||
| 140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
| 141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
| 142 | .shift = wshift, .invert = winvert} | 142 | .shift = wshift, .invert = winvert} |
| 143 | #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ | ||
| 144 | wevent, wflags) \ | ||
| 145 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | ||
| 146 | .shift = wshift, .invert = winvert, \ | ||
| 147 | .event = wevent, .event_flags = wflags} | ||
| 143 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ | 148 | #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ |
| 144 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 149 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
| 145 | .shift = wshift, .invert = winvert} | 150 | .shift = wshift, .invert = winvert} |
| 151 | #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ | ||
| 152 | wevent, wflags) \ | ||
| 153 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | ||
| 154 | .shift = wshift, .invert = winvert, \ | ||
| 155 | .event = wevent, .event_flags = wflags} | ||
| 146 | 156 | ||
| 147 | /* generic register modifier widget */ | 157 | /* generic widgets */ |
| 148 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | 158 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ |
| 149 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ | 159 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ |
| 150 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ | 160 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ |
| 151 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | 161 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ |
| 152 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | 162 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} |
| 163 | #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ | ||
| 164 | { .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ | ||
| 165 | .shift = wshift, .invert = winvert, .event = wevent, \ | ||
| 166 | .event_flags = wflags} | ||
| 153 | 167 | ||
| 154 | /* dapm kcontrol types */ | 168 | /* dapm kcontrol types */ |
| 155 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 169 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
| @@ -265,8 +279,6 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | |||
| 265 | /* dapm events */ | 279 | /* dapm events */ |
| 266 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 280 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
| 267 | int event); | 281 | int event); |
| 268 | int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev, | ||
| 269 | enum snd_soc_bias_level level); | ||
| 270 | 282 | ||
| 271 | /* dapm sys fs - used by the core */ | 283 | /* dapm sys fs - used by the core */ |
| 272 | int snd_soc_dapm_sys_add(struct device *dev); | 284 | int snd_soc_dapm_sys_add(struct device *dev); |
| @@ -298,6 +310,7 @@ enum snd_soc_dapm_type { | |||
| 298 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ | 310 | snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ |
| 299 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 311 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
| 300 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 312 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
| 313 | snd_soc_dapm_supply, /* power/clock supply */ | ||
| 301 | }; | 314 | }; |
| 302 | 315 | ||
| 303 | /* | 316 | /* |
| @@ -357,6 +370,8 @@ struct snd_soc_dapm_widget { | |||
| 357 | unsigned char suspend:1; /* was active before suspend */ | 370 | unsigned char suspend:1; /* was active before suspend */ |
| 358 | unsigned char pmdown:1; /* waiting for timeout */ | 371 | unsigned char pmdown:1; /* waiting for timeout */ |
| 359 | 372 | ||
| 373 | int (*power_check)(struct snd_soc_dapm_widget *w); | ||
| 374 | |||
| 360 | /* external events */ | 375 | /* external events */ |
| 361 | unsigned short event_flags; /* flags to specify event types */ | 376 | unsigned short event_flags; /* flags to specify event types */ |
| 362 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); | 377 | int (*event)(struct snd_soc_dapm_widget*, struct snd_kcontrol *, int); |
| @@ -368,6 +383,9 @@ struct snd_soc_dapm_widget { | |||
| 368 | /* widget input and outputs */ | 383 | /* widget input and outputs */ |
| 369 | struct list_head sources; | 384 | struct list_head sources; |
| 370 | struct list_head sinks; | 385 | struct list_head sinks; |
| 386 | |||
| 387 | /* used during DAPM updates */ | ||
| 388 | struct list_head power_list; | ||
| 371 | }; | 389 | }; |
| 372 | 390 | ||
| 373 | #endif | 391 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index a40bc6f316fc..cf6111d72b17 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -118,6 +118,14 @@ | |||
| 118 | .info = snd_soc_info_volsw, \ | 118 | .info = snd_soc_info_volsw, \ |
| 119 | .get = xhandler_get, .put = xhandler_put, \ | 119 | .get = xhandler_get, .put = xhandler_put, \ |
| 120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 120 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
| 121 | #define SOC_DOUBLE_EXT(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
| 122 | xhandler_get, xhandler_put) \ | ||
| 123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ | ||
| 124 | .info = snd_soc_info_volsw, \ | ||
| 125 | .get = xhandler_get, .put = xhandler_put, \ | ||
| 126 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 127 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
| 128 | .max = xmax, .invert = xinvert} } | ||
| 121 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ | 129 | #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ |
| 122 | xhandler_get, xhandler_put, tlv_array) \ | 130 | xhandler_get, xhandler_put, tlv_array) \ |
| 123 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 131 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| @@ -206,10 +214,6 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
| 206 | struct snd_soc_jack_gpio *gpios); | 214 | struct snd_soc_jack_gpio *gpios); |
| 207 | #endif | 215 | #endif |
| 208 | 216 | ||
| 209 | /* codec IO */ | ||
| 210 | #define snd_soc_read(codec, reg) codec->read(codec, reg) | ||
| 211 | #define snd_soc_write(codec, reg, value) codec->write(codec, reg, value) | ||
| 212 | |||
| 213 | /* codec register bit access */ | 217 | /* codec register bit access */ |
| 214 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 218 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 215 | unsigned short mask, unsigned short value); | 219 | unsigned short mask, unsigned short value); |
| @@ -331,6 +335,7 @@ struct snd_soc_codec { | |||
| 331 | struct module *owner; | 335 | struct module *owner; |
| 332 | struct mutex mutex; | 336 | struct mutex mutex; |
| 333 | struct device *dev; | 337 | struct device *dev; |
| 338 | struct snd_soc_device *socdev; | ||
| 334 | 339 | ||
| 335 | struct list_head list; | 340 | struct list_head list; |
| 336 | 341 | ||
| @@ -364,6 +369,8 @@ struct snd_soc_codec { | |||
| 364 | enum snd_soc_bias_level bias_level; | 369 | enum snd_soc_bias_level bias_level; |
| 365 | enum snd_soc_bias_level suspend_bias_level; | 370 | enum snd_soc_bias_level suspend_bias_level; |
| 366 | struct delayed_work delayed_work; | 371 | struct delayed_work delayed_work; |
| 372 | struct list_head up_list; | ||
| 373 | struct list_head down_list; | ||
| 367 | 374 | ||
| 368 | /* codec DAI's */ | 375 | /* codec DAI's */ |
| 369 | struct snd_soc_dai *dai; | 376 | struct snd_soc_dai *dai; |
| @@ -417,6 +424,12 @@ struct snd_soc_dai_link { | |||
| 417 | /* codec/machine specific init - e.g. add machine controls */ | 424 | /* codec/machine specific init - e.g. add machine controls */ |
| 418 | int (*init)(struct snd_soc_codec *codec); | 425 | int (*init)(struct snd_soc_codec *codec); |
| 419 | 426 | ||
| 427 | /* Symmetry requirements */ | ||
| 428 | unsigned int symmetric_rates:1; | ||
| 429 | |||
| 430 | /* Symmetry data - only valid if symmetry is being enforced */ | ||
| 431 | unsigned int rate; | ||
| 432 | |||
| 420 | /* DAI pcm */ | 433 | /* DAI pcm */ |
| 421 | struct snd_pcm *pcm; | 434 | struct snd_pcm *pcm; |
| 422 | }; | 435 | }; |
| @@ -490,6 +503,19 @@ struct soc_enum { | |||
| 490 | void *dapm; | 503 | void *dapm; |
| 491 | }; | 504 | }; |
| 492 | 505 | ||
| 506 | /* codec IO */ | ||
| 507 | static inline unsigned int snd_soc_read(struct snd_soc_codec *codec, | ||
| 508 | unsigned int reg) | ||
| 509 | { | ||
| 510 | return codec->read(codec, reg); | ||
| 511 | } | ||
| 512 | |||
| 513 | static inline unsigned int snd_soc_write(struct snd_soc_codec *codec, | ||
| 514 | unsigned int reg, unsigned int val) | ||
| 515 | { | ||
| 516 | return codec->write(codec, reg, val); | ||
| 517 | } | ||
| 518 | |||
| 493 | #include <sound/soc-dai.h> | 519 | #include <sound/soc-dai.h> |
| 494 | 520 | ||
| 495 | #endif | 521 | #endif |
diff --git a/include/sound/wm9081.h b/include/sound/wm9081.h new file mode 100644 index 000000000000..e173ddbf6bd4 --- /dev/null +++ b/include/sound/wm9081.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm9081.h -- Platform data for WM9081 | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_WM_9081_H | ||
| 12 | #define __LINUX_SND_WM_9081_H | ||
| 13 | |||
| 14 | struct wm9081_retune_mobile_setting { | ||
| 15 | const char *name; | ||
| 16 | unsigned int rate; | ||
| 17 | u16 config[20]; | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct wm9081_retune_mobile_config { | ||
| 21 | struct wm9081_retune_mobile_setting *configs; | ||
| 22 | int num_configs; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
