diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/drm/drm.h | 2 | ||||
| -rw-r--r-- | include/drm/drmP.h | 9 | ||||
| -rw-r--r-- | include/linux/cgroup.h | 1 | ||||
| -rw-r--r-- | include/linux/dmi.h | 3 | ||||
| -rw-r--r-- | include/linux/kprobes.h | 47 | ||||
| -rw-r--r-- | include/linux/libata.h | 2 | ||||
| -rw-r--r-- | include/linux/mod_devicetable.h | 7 | ||||
| -rw-r--r-- | include/linux/pci_ids.h | 4 | ||||
| -rw-r--r-- | include/linux/sched.h | 1 | ||||
| -rw-r--r-- | include/linux/suspend.h | 2 | ||||
| -rw-r--r-- | include/linux/syscalls.h | 5 | ||||
| -rw-r--r-- | include/linux/usb.h | 2 | ||||
| -rw-r--r-- | include/media/videobuf-dma-sg.h | 2 | ||||
| -rw-r--r-- | include/mtd/ubi-user.h | 132 |
14 files changed, 164 insertions, 55 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h index 32e5096554e9..8e77357334ad 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
| @@ -458,7 +458,7 @@ enum drm_vblank_seq_type { | |||
| 458 | _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ | 458 | _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ |
| 459 | _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ | 459 | _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ |
| 460 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ | 460 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ |
| 461 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking */ | 461 | _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ |
| 462 | }; | 462 | }; |
| 463 | 463 | ||
| 464 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) | 464 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index afb7858c068d..8190b9bcc2d9 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -545,13 +545,6 @@ struct drm_ctx_list { | |||
| 545 | struct drm_file *tag; /**< associated fd private data */ | 545 | struct drm_file *tag; /**< associated fd private data */ |
| 546 | }; | 546 | }; |
| 547 | 547 | ||
| 548 | struct drm_vbl_sig { | ||
| 549 | struct list_head head; | ||
| 550 | unsigned int sequence; | ||
| 551 | struct siginfo info; | ||
| 552 | struct task_struct *task; | ||
| 553 | }; | ||
| 554 | |||
| 555 | /* location of GART table */ | 548 | /* location of GART table */ |
| 556 | #define DRM_ATI_GART_MAIN 1 | 549 | #define DRM_ATI_GART_MAIN 1 |
| 557 | #define DRM_ATI_GART_FB 2 | 550 | #define DRM_ATI_GART_FB 2 |
| @@ -903,8 +896,6 @@ struct drm_device { | |||
| 903 | wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ | 896 | wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ |
| 904 | atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ | 897 | atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ |
| 905 | spinlock_t vbl_lock; | 898 | spinlock_t vbl_lock; |
| 906 | struct list_head *vbl_sigs; /**< signal list to send on VBLANK */ | ||
| 907 | atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/ | ||
| 908 | atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ | 899 | atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ |
| 909 | u32 *last_vblank; /* protected by dev->vbl_lock, used */ | 900 | u32 *last_vblank; /* protected by dev->vbl_lock, used */ |
| 910 | /* for wraparound handling */ | 901 | /* for wraparound handling */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e267e62827bb..e4e8e117d27d 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -99,6 +99,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css) | |||
| 99 | while (!atomic_inc_not_zero(&css->refcnt)) { | 99 | while (!atomic_inc_not_zero(&css->refcnt)) { |
| 100 | if (test_bit(CSS_REMOVED, &css->flags)) | 100 | if (test_bit(CSS_REMOVED, &css->flags)) |
| 101 | return false; | 101 | return false; |
| 102 | cpu_relax(); | ||
| 102 | } | 103 | } |
| 103 | return true; | 104 | return true; |
| 104 | } | 105 | } |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 34161907b2f8..d741b9ceb0e0 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
| @@ -38,6 +38,7 @@ struct dmi_device { | |||
| 38 | #ifdef CONFIG_DMI | 38 | #ifdef CONFIG_DMI |
| 39 | 39 | ||
| 40 | extern int dmi_check_system(const struct dmi_system_id *list); | 40 | extern int dmi_check_system(const struct dmi_system_id *list); |
| 41 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); | ||
| 41 | extern const char * dmi_get_system_info(int field); | 42 | extern const char * dmi_get_system_info(int field); |
| 42 | extern const struct dmi_device * dmi_find_device(int type, const char *name, | 43 | extern const struct dmi_device * dmi_find_device(int type, const char *name, |
| 43 | const struct dmi_device *from); | 44 | const struct dmi_device *from); |
| @@ -64,6 +65,8 @@ static inline int dmi_walk(void (*decode)(const struct dmi_header *)) | |||
| 64 | { return -1; } | 65 | { return -1; } |
| 65 | static inline bool dmi_match(enum dmi_field f, const char *str) | 66 | static inline bool dmi_match(enum dmi_field f, const char *str) |
| 66 | { return false; } | 67 | { return false; } |
| 68 | static inline const struct dmi_system_id * | ||
| 69 | dmi_first_match(const struct dmi_system_id *list) { return NULL; } | ||
| 67 | 70 | ||
| 68 | #endif | 71 | #endif |
| 69 | 72 | ||
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index d6ea19e314bb..32851eef48f0 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
| @@ -49,6 +49,13 @@ | |||
| 49 | 49 | ||
| 50 | /* Attach to insert probes on any functions which should be ignored*/ | 50 | /* Attach to insert probes on any functions which should be ignored*/ |
| 51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace | 51 | #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace |
| 52 | #else /* CONFIG_KPROBES */ | ||
| 53 | typedef int kprobe_opcode_t; | ||
| 54 | struct arch_specific_insn { | ||
| 55 | int dummy; | ||
| 56 | }; | ||
| 57 | #define __kprobes notrace | ||
| 58 | #endif /* CONFIG_KPROBES */ | ||
| 52 | 59 | ||
| 53 | struct kprobe; | 60 | struct kprobe; |
| 54 | struct pt_regs; | 61 | struct pt_regs; |
| @@ -131,23 +138,6 @@ struct jprobe { | |||
| 131 | /* For backward compatibility with old code using JPROBE_ENTRY() */ | 138 | /* For backward compatibility with old code using JPROBE_ENTRY() */ |
| 132 | #define JPROBE_ENTRY(handler) (handler) | 139 | #define JPROBE_ENTRY(handler) (handler) |
| 133 | 140 | ||
| 134 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
| 135 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
| 136 | |||
| 137 | #ifdef CONFIG_KRETPROBES | ||
| 138 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | ||
| 139 | struct pt_regs *regs); | ||
| 140 | extern int arch_trampoline_kprobe(struct kprobe *p); | ||
| 141 | #else /* CONFIG_KRETPROBES */ | ||
| 142 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | ||
| 143 | struct pt_regs *regs) | ||
| 144 | { | ||
| 145 | } | ||
| 146 | static inline int arch_trampoline_kprobe(struct kprobe *p) | ||
| 147 | { | ||
| 148 | return 0; | ||
| 149 | } | ||
| 150 | #endif /* CONFIG_KRETPROBES */ | ||
| 151 | /* | 141 | /* |
| 152 | * Function-return probe - | 142 | * Function-return probe - |
| 153 | * Note: | 143 | * Note: |
| @@ -188,6 +178,25 @@ struct kprobe_blackpoint { | |||
| 188 | unsigned long range; | 178 | unsigned long range; |
| 189 | }; | 179 | }; |
| 190 | 180 | ||
| 181 | #ifdef CONFIG_KPROBES | ||
| 182 | DECLARE_PER_CPU(struct kprobe *, current_kprobe); | ||
| 183 | DECLARE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | ||
| 184 | |||
| 185 | #ifdef CONFIG_KRETPROBES | ||
| 186 | extern void arch_prepare_kretprobe(struct kretprobe_instance *ri, | ||
| 187 | struct pt_regs *regs); | ||
| 188 | extern int arch_trampoline_kprobe(struct kprobe *p); | ||
| 189 | #else /* CONFIG_KRETPROBES */ | ||
| 190 | static inline void arch_prepare_kretprobe(struct kretprobe *rp, | ||
| 191 | struct pt_regs *regs) | ||
| 192 | { | ||
| 193 | } | ||
| 194 | static inline int arch_trampoline_kprobe(struct kprobe *p) | ||
| 195 | { | ||
| 196 | return 0; | ||
| 197 | } | ||
| 198 | #endif /* CONFIG_KRETPROBES */ | ||
| 199 | |||
| 191 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; | 200 | extern struct kretprobe_blackpoint kretprobe_blacklist[]; |
| 192 | 201 | ||
| 193 | static inline void kretprobe_assert(struct kretprobe_instance *ri, | 202 | static inline void kretprobe_assert(struct kretprobe_instance *ri, |
| @@ -264,10 +273,6 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | |||
| 264 | 273 | ||
| 265 | #else /* CONFIG_KPROBES */ | 274 | #else /* CONFIG_KPROBES */ |
| 266 | 275 | ||
| 267 | #define __kprobes notrace | ||
| 268 | struct jprobe; | ||
| 269 | struct kretprobe; | ||
| 270 | |||
| 271 | static inline struct kprobe *get_kprobe(void *addr) | 276 | static inline struct kprobe *get_kprobe(void *addr) |
| 272 | { | 277 | { |
| 273 | return NULL; | 278 | return NULL; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 2c6bd66209ff..bca3ba25f52a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -187,6 +187,8 @@ enum { | |||
| 187 | ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD | 187 | ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD |
| 188 | * doesn't handle PIO interrupts */ | 188 | * doesn't handle PIO interrupts */ |
| 189 | ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */ | 189 | ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */ |
| 190 | ATA_FLAG_NO_POWEROFF_SPINDOWN = (1 << 11), /* don't spindown before poweroff */ | ||
| 191 | ATA_FLAG_NO_HIBERNATE_SPINDOWN = (1 << 12), /* don't spindown before hibernation */ | ||
| 190 | ATA_FLAG_DEBUGMSG = (1 << 13), | 192 | ATA_FLAG_DEBUGMSG = (1 << 13), |
| 191 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ | 193 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ |
| 192 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ | 194 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 97b91d1abb43..fde86671f48f 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
| @@ -443,6 +443,13 @@ struct dmi_system_id { | |||
| 443 | struct dmi_strmatch matches[4]; | 443 | struct dmi_strmatch matches[4]; |
| 444 | void *driver_data; | 444 | void *driver_data; |
| 445 | }; | 445 | }; |
| 446 | /* | ||
| 447 | * struct dmi_device_id appears during expansion of | ||
| 448 | * "MODULE_DEVICE_TABLE(dmi, x)". Compiler doesn't look inside it | ||
| 449 | * but this is enough for gcc 3.4.6 to error out: | ||
| 450 | * error: storage size of '__mod_dmi_device_table' isn't known | ||
| 451 | */ | ||
| 452 | #define dmi_device_id dmi_system_id | ||
| 446 | #endif | 453 | #endif |
| 447 | 454 | ||
| 448 | #define DMI_MATCH(a, b) { a, b } | 455 | #define DMI_MATCH(a, b) { a, b } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d56ad9c21c09..febc10ed3858 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -1357,6 +1357,7 @@ | |||
| 1357 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 | 1357 | #define PCI_DEVICE_ID_VIA_8783_0 0x3208 |
| 1358 | #define PCI_DEVICE_ID_VIA_8237 0x3227 | 1358 | #define PCI_DEVICE_ID_VIA_8237 0x3227 |
| 1359 | #define PCI_DEVICE_ID_VIA_8251 0x3287 | 1359 | #define PCI_DEVICE_ID_VIA_8251 0x3287 |
| 1360 | #define PCI_DEVICE_ID_VIA_8261 0x3402 | ||
| 1360 | #define PCI_DEVICE_ID_VIA_8237A 0x3337 | 1361 | #define PCI_DEVICE_ID_VIA_8237A 0x3337 |
| 1361 | #define PCI_DEVICE_ID_VIA_8237S 0x3372 | 1362 | #define PCI_DEVICE_ID_VIA_8237S 0x3372 |
| 1362 | #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324 | 1363 | #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324 |
| @@ -1366,10 +1367,13 @@ | |||
| 1366 | #define PCI_DEVICE_ID_VIA_CX700 0x8324 | 1367 | #define PCI_DEVICE_ID_VIA_CX700 0x8324 |
| 1367 | #define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 | 1368 | #define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 |
| 1368 | #define PCI_DEVICE_ID_VIA_VX800 0x8353 | 1369 | #define PCI_DEVICE_ID_VIA_VX800 0x8353 |
| 1370 | #define PCI_DEVICE_ID_VIA_VX855 0x8409 | ||
| 1369 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 | 1371 | #define PCI_DEVICE_ID_VIA_8371_1 0x8391 |
| 1370 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 | 1372 | #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 |
| 1371 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 | 1373 | #define PCI_DEVICE_ID_VIA_838X_1 0xB188 |
| 1372 | #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 | 1374 | #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 |
| 1375 | #define PCI_DEVICE_ID_VIA_C409_IDE 0XC409 | ||
| 1376 | #define PCI_DEVICE_ID_VIA_ANON 0xFFFF | ||
| 1373 | 1377 | ||
| 1374 | #define PCI_VENDOR_ID_SIEMENS 0x110A | 1378 | #define PCI_VENDOR_ID_SIEMENS 0x110A |
| 1375 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 | 1379 | #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 681394f3a0cf..2225c207801c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -630,7 +630,6 @@ struct user_struct { | |||
| 630 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ | 630 | atomic_t inotify_devs; /* How many inotify devs does this user have opened? */ |
| 631 | #endif | 631 | #endif |
| 632 | #ifdef CONFIG_EPOLL | 632 | #ifdef CONFIG_EPOLL |
| 633 | atomic_t epoll_devs; /* The number of epoll descriptors currently open */ | ||
| 634 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ | 633 | atomic_t epoll_watches; /* The number of file descriptors currently watched */ |
| 635 | #endif | 634 | #endif |
| 636 | #ifdef CONFIG_POSIX_MQUEUE | 635 | #ifdef CONFIG_POSIX_MQUEUE |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 2b409c44db83..c7d9bb1832ba 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -237,6 +237,7 @@ extern int hibernate_nvs_alloc(void); | |||
| 237 | extern void hibernate_nvs_free(void); | 237 | extern void hibernate_nvs_free(void); |
| 238 | extern void hibernate_nvs_save(void); | 238 | extern void hibernate_nvs_save(void); |
| 239 | extern void hibernate_nvs_restore(void); | 239 | extern void hibernate_nvs_restore(void); |
| 240 | extern bool system_entering_hibernation(void); | ||
| 240 | #else /* CONFIG_HIBERNATION */ | 241 | #else /* CONFIG_HIBERNATION */ |
| 241 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 242 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
| 242 | static inline void swsusp_set_page_free(struct page *p) {} | 243 | static inline void swsusp_set_page_free(struct page *p) {} |
| @@ -252,6 +253,7 @@ static inline int hibernate_nvs_alloc(void) { return 0; } | |||
| 252 | static inline void hibernate_nvs_free(void) {} | 253 | static inline void hibernate_nvs_free(void) {} |
| 253 | static inline void hibernate_nvs_save(void) {} | 254 | static inline void hibernate_nvs_save(void) {} |
| 254 | static inline void hibernate_nvs_restore(void) {} | 255 | static inline void hibernate_nvs_restore(void) {} |
| 256 | static inline bool system_entering_hibernation(void) { return false; } | ||
| 255 | #endif /* CONFIG_HIBERNATION */ | 257 | #endif /* CONFIG_HIBERNATION */ |
| 256 | 258 | ||
| 257 | #ifdef CONFIG_PM_SLEEP | 259 | #ifdef CONFIG_PM_SLEEP |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 16875f89e6a7..0eda02ff2414 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -108,9 +108,14 @@ struct old_linux_dirent; | |||
| 108 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ | 108 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \ |
| 109 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) | 109 | "\t.globl ." #alias "\n\t.set ." #alias ", ." #name) |
| 110 | #else | 110 | #else |
| 111 | #ifdef CONFIG_ALPHA | ||
| 112 | #define SYSCALL_ALIAS(alias, name) \ | ||
| 113 | asm ( #alias " = " #name "\n\t.globl " #alias) | ||
| 114 | #else | ||
| 111 | #define SYSCALL_ALIAS(alias, name) \ | 115 | #define SYSCALL_ALIAS(alias, name) \ |
| 112 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) | 116 | asm ("\t.globl " #alias "\n\t.set " #alias ", " #name) |
| 113 | #endif | 117 | #endif |
| 118 | #endif | ||
| 114 | 119 | ||
| 115 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | 120 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS |
| 116 | 121 | ||
diff --git a/include/linux/usb.h b/include/linux/usb.h index 85ee9be9361e..88079fd60235 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -418,6 +418,8 @@ struct usb_tt; | |||
| 418 | * @autosuspend_disabled: autosuspend disabled by the user | 418 | * @autosuspend_disabled: autosuspend disabled by the user |
| 419 | * @autoresume_disabled: autoresume disabled by the user | 419 | * @autoresume_disabled: autoresume disabled by the user |
| 420 | * @skip_sys_resume: skip the next system resume | 420 | * @skip_sys_resume: skip the next system resume |
| 421 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | ||
| 422 | * specific data for the device. | ||
| 421 | * | 423 | * |
| 422 | * Notes: | 424 | * Notes: |
| 423 | * Usbcore drivers should not set usbdev->state directly. Instead use | 425 | * Usbcore drivers should not set usbdev->state directly. Instead use |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index 90edd22d343c..dda47f0082e9 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
| @@ -49,7 +49,7 @@ struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, | |||
| 49 | * does memory allocation too using vmalloc_32(). | 49 | * does memory allocation too using vmalloc_32(). |
| 50 | * | 50 | * |
| 51 | * videobuf_dma_*() | 51 | * videobuf_dma_*() |
| 52 | * see Documentation/DMA-mapping.txt, these functions to | 52 | * see Documentation/PCI/PCI-DMA-mapping.txt, these functions to |
| 53 | * basically the same. The map function does also build a | 53 | * basically the same. The map function does also build a |
| 54 | * scatterlist for the buffer (and unmap frees it ...) | 54 | * scatterlist for the buffer (and unmap frees it ...) |
| 55 | * | 55 | * |
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h index 2dc2eb2b8e22..296efae3525e 100644 --- a/include/mtd/ubi-user.h +++ b/include/mtd/ubi-user.h | |||
| @@ -40,37 +40,37 @@ | |||
| 40 | * UBI volume creation | 40 | * UBI volume creation |
| 41 | * ~~~~~~~~~~~~~~~~~~~ | 41 | * ~~~~~~~~~~~~~~~~~~~ |
| 42 | * | 42 | * |
| 43 | * UBI volumes are created via the %UBI_IOCMKVOL IOCTL command of UBI character | 43 | * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character |
| 44 | * device. A &struct ubi_mkvol_req object has to be properly filled and a | 44 | * device. A &struct ubi_mkvol_req object has to be properly filled and a |
| 45 | * pointer to it has to be passed to the IOCTL. | 45 | * pointer to it has to be passed to the ioctl. |
| 46 | * | 46 | * |
| 47 | * UBI volume deletion | 47 | * UBI volume deletion |
| 48 | * ~~~~~~~~~~~~~~~~~~~ | 48 | * ~~~~~~~~~~~~~~~~~~~ |
| 49 | * | 49 | * |
| 50 | * To delete a volume, the %UBI_IOCRMVOL IOCTL command of the UBI character | 50 | * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character |
| 51 | * device should be used. A pointer to the 32-bit volume ID hast to be passed | 51 | * device should be used. A pointer to the 32-bit volume ID hast to be passed |
| 52 | * to the IOCTL. | 52 | * to the ioctl. |
| 53 | * | 53 | * |
| 54 | * UBI volume re-size | 54 | * UBI volume re-size |
| 55 | * ~~~~~~~~~~~~~~~~~~ | 55 | * ~~~~~~~~~~~~~~~~~~ |
| 56 | * | 56 | * |
| 57 | * To re-size a volume, the %UBI_IOCRSVOL IOCTL command of the UBI character | 57 | * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character |
| 58 | * device should be used. A &struct ubi_rsvol_req object has to be properly | 58 | * device should be used. A &struct ubi_rsvol_req object has to be properly |
| 59 | * filled and a pointer to it has to be passed to the IOCTL. | 59 | * filled and a pointer to it has to be passed to the ioctl. |
| 60 | * | 60 | * |
| 61 | * UBI volumes re-name | 61 | * UBI volumes re-name |
| 62 | * ~~~~~~~~~~~~~~~~~~~ | 62 | * ~~~~~~~~~~~~~~~~~~~ |
| 63 | * | 63 | * |
| 64 | * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command | 64 | * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command |
| 65 | * of the UBI character device should be used. A &struct ubi_rnvol_req object | 65 | * of the UBI character device should be used. A &struct ubi_rnvol_req object |
| 66 | * has to be properly filled and a pointer to it has to be passed to the IOCTL. | 66 | * has to be properly filled and a pointer to it has to be passed to the ioctl. |
| 67 | * | 67 | * |
| 68 | * UBI volume update | 68 | * UBI volume update |
| 69 | * ~~~~~~~~~~~~~~~~~ | 69 | * ~~~~~~~~~~~~~~~~~ |
| 70 | * | 70 | * |
| 71 | * Volume update should be done via the %UBI_IOCVOLUP IOCTL command of the | 71 | * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the |
| 72 | * corresponding UBI volume character device. A pointer to a 64-bit update | 72 | * corresponding UBI volume character device. A pointer to a 64-bit update |
| 73 | * size should be passed to the IOCTL. After this, UBI expects user to write | 73 | * size should be passed to the ioctl. After this, UBI expects user to write |
| 74 | * this number of bytes to the volume character device. The update is finished | 74 | * this number of bytes to the volume character device. The update is finished |
| 75 | * when the claimed number of bytes is passed. So, the volume update sequence | 75 | * when the claimed number of bytes is passed. So, the volume update sequence |
| 76 | * is something like: | 76 | * is something like: |
| @@ -80,14 +80,58 @@ | |||
| 80 | * write(fd, buf, image_size); | 80 | * write(fd, buf, image_size); |
| 81 | * close(fd); | 81 | * close(fd); |
| 82 | * | 82 | * |
| 83 | * Atomic eraseblock change | 83 | * Logical eraseblock erase |
| 84 | * ~~~~~~~~~~~~~~~~~~~~~~~~ | 84 | * ~~~~~~~~~~~~~~~~~~~~~~~~ |
| 85 | * | 85 | * |
| 86 | * Atomic eraseblock change operation is done via the %UBI_IOCEBCH IOCTL | 86 | * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the |
| 87 | * command of the corresponding UBI volume character device. A pointer to | 87 | * corresponding UBI volume character device should be used. This command |
| 88 | * &struct ubi_leb_change_req has to be passed to the IOCTL. Then the user is | 88 | * unmaps the requested logical eraseblock, makes sure the corresponding |
| 89 | * expected to write the requested amount of bytes. This is similar to the | 89 | * physical eraseblock is successfully erased, and returns. |
| 90 | * "volume update" IOCTL. | 90 | * |
| 91 | * Atomic logical eraseblock change | ||
| 92 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 93 | * | ||
| 94 | * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH | ||
| 95 | * ioctl command of the corresponding UBI volume character device. A pointer to | ||
| 96 | * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the | ||
| 97 | * user is expected to write the requested amount of bytes (similarly to what | ||
| 98 | * should be done in case of the "volume update" ioctl). | ||
| 99 | * | ||
| 100 | * Logical eraseblock map | ||
| 101 | * ~~~~~~~~~~~~~~~~~~~~~ | ||
| 102 | * | ||
| 103 | * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP | ||
| 104 | * ioctl command should be used. A pointer to a &struct ubi_map_req object is | ||
| 105 | * expected to be passed. The ioctl maps the requested logical eraseblock to | ||
| 106 | * a physical eraseblock and returns. Only non-mapped logical eraseblocks can | ||
| 107 | * be mapped. If the logical eraseblock specified in the request is already | ||
| 108 | * mapped to a physical eraseblock, the ioctl fails and returns error. | ||
| 109 | * | ||
| 110 | * Logical eraseblock unmap | ||
| 111 | * ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 112 | * | ||
| 113 | * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP | ||
| 114 | * ioctl command should be used. The ioctl unmaps the logical eraseblocks, | ||
| 115 | * schedules corresponding physical eraseblock for erasure, and returns. Unlike | ||
| 116 | * the "LEB erase" command, it does not wait for the physical eraseblock being | ||
| 117 | * erased. Note, the side effect of this is that if an unclean reboot happens | ||
| 118 | * after the unmap ioctl returns, you may find the LEB mapped again to the same | ||
| 119 | * physical eraseblock after the UBI is run again. | ||
| 120 | * | ||
| 121 | * Check if logical eraseblock is mapped | ||
| 122 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 123 | * | ||
| 124 | * To check if a logical eraseblock is mapped to a physical eraseblock, the | ||
| 125 | * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is | ||
| 126 | * not mapped, and %1 if it is mapped. | ||
| 127 | * | ||
| 128 | * Set an UBI volume property | ||
| 129 | * ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 130 | * | ||
| 131 | * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be | ||
| 132 | * used. A pointer to a &struct ubi_set_prop_req object is expected to be | ||
| 133 | * passed. The object describes which property should be set, and to which value | ||
| 134 | * it should be set. | ||
| 91 | */ | 135 | */ |
| 92 | 136 | ||
| 93 | /* | 137 | /* |
| @@ -101,7 +145,7 @@ | |||
| 101 | /* Maximum volume name length */ | 145 | /* Maximum volume name length */ |
| 102 | #define UBI_MAX_VOLUME_NAME 127 | 146 | #define UBI_MAX_VOLUME_NAME 127 |
| 103 | 147 | ||
| 104 | /* IOCTL commands of UBI character devices */ | 148 | /* ioctl commands of UBI character devices */ |
| 105 | 149 | ||
| 106 | #define UBI_IOC_MAGIC 'o' | 150 | #define UBI_IOC_MAGIC 'o' |
| 107 | 151 | ||
| @@ -114,7 +158,7 @@ | |||
| 114 | /* Re-name volumes */ | 158 | /* Re-name volumes */ |
| 115 | #define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req) | 159 | #define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req) |
| 116 | 160 | ||
| 117 | /* IOCTL commands of the UBI control character device */ | 161 | /* ioctl commands of the UBI control character device */ |
| 118 | 162 | ||
| 119 | #define UBI_CTRL_IOC_MAGIC 'o' | 163 | #define UBI_CTRL_IOC_MAGIC 'o' |
| 120 | 164 | ||
| @@ -123,16 +167,24 @@ | |||
| 123 | /* Detach an MTD device */ | 167 | /* Detach an MTD device */ |
| 124 | #define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t) | 168 | #define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, int32_t) |
| 125 | 169 | ||
| 126 | /* IOCTL commands of UBI volume character devices */ | 170 | /* ioctl commands of UBI volume character devices */ |
| 127 | 171 | ||
| 128 | #define UBI_VOL_IOC_MAGIC 'O' | 172 | #define UBI_VOL_IOC_MAGIC 'O' |
| 129 | 173 | ||
| 130 | /* Start UBI volume update */ | 174 | /* Start UBI volume update */ |
| 131 | #define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t) | 175 | #define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, int64_t) |
| 132 | /* An eraseblock erasure command, used for debugging, disabled by default */ | 176 | /* LEB erasure command, used for debugging, disabled by default */ |
| 133 | #define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t) | 177 | #define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, int32_t) |
| 134 | /* An atomic eraseblock change command */ | 178 | /* Atomic LEB change command */ |
| 135 | #define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t) | 179 | #define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, int32_t) |
| 180 | /* Map LEB command */ | ||
| 181 | #define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req) | ||
| 182 | /* Unmap LEB command */ | ||
| 183 | #define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, int32_t) | ||
| 184 | /* Check if LEB is mapped command */ | ||
| 185 | #define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, int32_t) | ||
| 186 | /* Set an UBI volume property */ | ||
| 187 | #define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req) | ||
| 136 | 188 | ||
| 137 | /* Maximum MTD device name length supported by UBI */ | 189 | /* Maximum MTD device name length supported by UBI */ |
| 138 | #define MAX_UBI_MTD_NAME_LEN 127 | 190 | #define MAX_UBI_MTD_NAME_LEN 127 |
| @@ -168,6 +220,16 @@ enum { | |||
| 168 | UBI_STATIC_VOLUME = 4, | 220 | UBI_STATIC_VOLUME = 4, |
| 169 | }; | 221 | }; |
| 170 | 222 | ||
| 223 | /* | ||
| 224 | * UBI set property ioctl constants | ||
| 225 | * | ||
| 226 | * @UBI_PROP_DIRECT_WRITE: allow / disallow user to directly write and | ||
| 227 | * erase individual eraseblocks on dynamic volumes | ||
| 228 | */ | ||
| 229 | enum { | ||
| 230 | UBI_PROP_DIRECT_WRITE = 1, | ||
| 231 | }; | ||
| 232 | |||
| 171 | /** | 233 | /** |
| 172 | * struct ubi_attach_req - attach MTD device request. | 234 | * struct ubi_attach_req - attach MTD device request. |
| 173 | * @ubi_num: UBI device number to create | 235 | * @ubi_num: UBI device number to create |
| @@ -305,8 +367,8 @@ struct ubi_rnvol_req { | |||
| 305 | } __attribute__ ((packed)); | 367 | } __attribute__ ((packed)); |
| 306 | 368 | ||
| 307 | /** | 369 | /** |
| 308 | * struct ubi_leb_change_req - a data structure used in atomic logical | 370 | * struct ubi_leb_change_req - a data structure used in atomic LEB change |
| 309 | * eraseblock change requests. | 371 | * requests. |
| 310 | * @lnum: logical eraseblock number to change | 372 | * @lnum: logical eraseblock number to change |
| 311 | * @bytes: how many bytes will be written to the logical eraseblock | 373 | * @bytes: how many bytes will be written to the logical eraseblock |
| 312 | * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) | 374 | * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) |
| @@ -319,4 +381,30 @@ struct ubi_leb_change_req { | |||
| 319 | int8_t padding[7]; | 381 | int8_t padding[7]; |
| 320 | } __attribute__ ((packed)); | 382 | } __attribute__ ((packed)); |
| 321 | 383 | ||
| 384 | /** | ||
| 385 | * struct ubi_map_req - a data structure used in map LEB requests. | ||
| 386 | * @lnum: logical eraseblock number to unmap | ||
| 387 | * @dtype: data type (%UBI_LONGTERM, %UBI_SHORTTERM, %UBI_UNKNOWN) | ||
| 388 | * @padding: reserved for future, not used, has to be zeroed | ||
| 389 | */ | ||
| 390 | struct ubi_map_req { | ||
| 391 | int32_t lnum; | ||
| 392 | int8_t dtype; | ||
| 393 | int8_t padding[3]; | ||
| 394 | } __attribute__ ((packed)); | ||
| 395 | |||
| 396 | |||
| 397 | /** | ||
| 398 | * struct ubi_set_prop_req - a data structure used to set an ubi volume | ||
| 399 | * property. | ||
| 400 | * @property: property to set (%UBI_PROP_DIRECT_WRITE) | ||
| 401 | * @padding: reserved for future, not used, has to be zeroed | ||
| 402 | * @value: value to set | ||
| 403 | */ | ||
| 404 | struct ubi_set_prop_req { | ||
| 405 | uint8_t property; | ||
| 406 | uint8_t padding[7]; | ||
| 407 | uint64_t value; | ||
| 408 | } __attribute__ ((packed)); | ||
| 409 | |||
| 322 | #endif /* __UBI_USER_H__ */ | 410 | #endif /* __UBI_USER_H__ */ |
