diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/iommu.h | 30 | ||||
-rw-r--r-- | include/linux/llist.h | 25 | ||||
-rw-r--r-- | include/linux/memcontrol.h | 2 | ||||
-rw-r--r-- | include/linux/mmu_notifier.h | 2 | ||||
-rw-r--r-- | include/linux/usb.h | 2 | ||||
-rw-r--r-- | include/linux/usb/hcd.h | 3 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 4 |
7 files changed, 64 insertions, 4 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1c1042..ba3b8a98a049 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -58,8 +58,10 @@ struct iommu_domain { | |||
58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
59 | 59 | ||
60 | enum iommu_attr { | 60 | enum iommu_attr { |
61 | DOMAIN_ATTR_MAX, | ||
62 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
62 | DOMAIN_ATTR_PAGING, | ||
63 | DOMAIN_ATTR_WINDOWS, | ||
64 | DOMAIN_ATTR_MAX, | ||
63 | }; | 65 | }; |
64 | 66 | ||
65 | #ifdef CONFIG_IOMMU_API | 67 | #ifdef CONFIG_IOMMU_API |
@@ -100,6 +102,16 @@ struct iommu_ops { | |||
100 | enum iommu_attr attr, void *data); | 102 | enum iommu_attr attr, void *data); |
101 | int (*domain_set_attr)(struct iommu_domain *domain, | 103 | int (*domain_set_attr)(struct iommu_domain *domain, |
102 | enum iommu_attr attr, void *data); | 104 | enum iommu_attr attr, void *data); |
105 | |||
106 | /* Window handling functions */ | ||
107 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, | ||
108 | phys_addr_t paddr, u64 size); | ||
109 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); | ||
110 | /* Set the numer of window per domain */ | ||
111 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); | ||
112 | /* Get the numer of window per domain */ | ||
113 | u32 (*domain_get_windows)(struct iommu_domain *domain); | ||
114 | |||
103 | unsigned long pgsize_bitmap; | 115 | unsigned long pgsize_bitmap; |
104 | }; | 116 | }; |
105 | 117 | ||
@@ -157,6 +169,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | |||
157 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 169 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
158 | void *data); | 170 | void *data); |
159 | 171 | ||
172 | /* Window handling function prototypes */ | ||
173 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | ||
174 | phys_addr_t offset, u64 size); | ||
175 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); | ||
160 | /** | 176 | /** |
161 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 177 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
162 | * @domain: the iommu domain where the fault has happened | 178 | * @domain: the iommu domain where the fault has happened |
@@ -239,6 +255,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
239 | return -ENODEV; | 255 | return -ENODEV; |
240 | } | 256 | } |
241 | 257 | ||
258 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | ||
259 | u32 wnd_nr, phys_addr_t paddr, | ||
260 | u64 size) | ||
261 | { | ||
262 | return -ENODEV; | ||
263 | } | ||
264 | |||
265 | static inline void iommu_domain_window_disable(struct iommu_domain *domain, | ||
266 | u32 wnd_nr) | ||
267 | { | ||
268 | } | ||
269 | |||
242 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 270 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
243 | unsigned long iova) | 271 | unsigned long iova) |
244 | { | 272 | { |
diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e82..d0ab98f73d38 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
@@ -125,6 +125,31 @@ static inline void init_llist_head(struct llist_head *list) | |||
125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) | 125 | (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * llist_for_each_entry_safe - iterate safely against remove over some entries | ||
129 | * of lock-less list of given type. | ||
130 | * @pos: the type * to use as a loop cursor. | ||
131 | * @n: another type * to use as a temporary storage. | ||
132 | * @node: the fist entry of deleted list entries. | ||
133 | * @member: the name of the llist_node with the struct. | ||
134 | * | ||
135 | * In general, some entries of the lock-less list can be traversed | ||
136 | * safely only after being removed from list, so start with an entry | ||
137 | * instead of list head. This variant allows removal of entries | ||
138 | * as we iterate. | ||
139 | * | ||
140 | * If being used on entries deleted from lock-less list directly, the | ||
141 | * traverse order is from the newest to the oldest added entry. If | ||
142 | * you want to traverse from the oldest to the newest, you must | ||
143 | * reverse the order by yourself before traversing. | ||
144 | */ | ||
145 | #define llist_for_each_entry_safe(pos, n, node, member) \ | ||
146 | for ((pos) = llist_entry((node), typeof(*(pos)), member), \ | ||
147 | (n) = (pos)->member.next; \ | ||
148 | &(pos)->member != NULL; \ | ||
149 | (pos) = llist_entry(n, typeof(*(pos)), member), \ | ||
150 | (n) = (&(pos)->member != NULL) ? (pos)->member.next : NULL) | ||
151 | |||
152 | /** | ||
128 | * llist_empty - tests whether a lock-less list is empty | 153 | * llist_empty - tests whether a lock-less list is empty |
129 | * @head: the list to test | 154 | * @head: the list to test |
130 | * | 155 | * |
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 0108a56f814e..28bd5fa2ff2e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -429,7 +429,7 @@ extern int memcg_limited_groups_array_size; | |||
429 | * the slab_mutex must be held when looping through those caches | 429 | * the slab_mutex must be held when looping through those caches |
430 | */ | 430 | */ |
431 | #define for_each_memcg_cache_index(_idx) \ | 431 | #define for_each_memcg_cache_index(_idx) \ |
432 | for ((_idx) = 0; i < memcg_limited_groups_array_size; (_idx)++) | 432 | for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++) |
433 | 433 | ||
434 | static inline bool memcg_kmem_enabled(void) | 434 | static inline bool memcg_kmem_enabled(void) |
435 | { | 435 | { |
diff --git a/include/linux/mmu_notifier.h b/include/linux/mmu_notifier.h index bc823c4c028b..deca87452528 100644 --- a/include/linux/mmu_notifier.h +++ b/include/linux/mmu_notifier.h | |||
@@ -151,7 +151,7 @@ struct mmu_notifier_ops { | |||
151 | * Therefore notifier chains can only be traversed when either | 151 | * Therefore notifier chains can only be traversed when either |
152 | * | 152 | * |
153 | * 1. mmap_sem is held. | 153 | * 1. mmap_sem is held. |
154 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->mutex). | 154 | * 2. One of the reverse map locks is held (i_mmap_mutex or anon_vma->rwsem). |
155 | * 3. No other concurrent thread can access the list (release) | 155 | * 3. No other concurrent thread can access the list (release) |
156 | */ | 156 | */ |
157 | struct mmu_notifier { | 157 | struct mmu_notifier { |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 689b14b26c8d..4d22d0f6167a 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -357,6 +357,8 @@ struct usb_bus { | |||
357 | int bandwidth_int_reqs; /* number of Interrupt requests */ | 357 | int bandwidth_int_reqs; /* number of Interrupt requests */ |
358 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ | 358 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ |
359 | 359 | ||
360 | unsigned resuming_ports; /* bit array: resuming root-hub ports */ | ||
361 | |||
360 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 362 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
361 | struct mon_bus *mon_bus; /* non-null when associated */ | 363 | struct mon_bus *mon_bus; /* non-null when associated */ |
362 | int monitored; /* non-zero when monitored */ | 364 | int monitored; /* non-zero when monitored */ |
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 608050b2545f..0a78df5f6cfd 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
@@ -430,6 +430,9 @@ extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd); | |||
430 | extern void usb_wakeup_notification(struct usb_device *hdev, | 430 | extern void usb_wakeup_notification(struct usb_device *hdev, |
431 | unsigned int portnum); | 431 | unsigned int portnum); |
432 | 432 | ||
433 | extern void usb_hcd_start_port_resume(struct usb_bus *bus, int portnum); | ||
434 | extern void usb_hcd_end_port_resume(struct usb_bus *bus, int portnum); | ||
435 | |||
433 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ | 436 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ |
434 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) | 437 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) |
435 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) | 438 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 5de7a220e986..0e5ac93bab10 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -33,6 +33,7 @@ struct usbnet { | |||
33 | wait_queue_head_t *wait; | 33 | wait_queue_head_t *wait; |
34 | struct mutex phy_mutex; | 34 | struct mutex phy_mutex; |
35 | unsigned char suspend_count; | 35 | unsigned char suspend_count; |
36 | unsigned char pkt_cnt, pkt_err; | ||
36 | 37 | ||
37 | /* i/o info: pipes etc */ | 38 | /* i/o info: pipes etc */ |
38 | unsigned in, out; | 39 | unsigned in, out; |
@@ -70,6 +71,7 @@ struct usbnet { | |||
70 | # define EVENT_DEV_OPEN 7 | 71 | # define EVENT_DEV_OPEN 7 |
71 | # define EVENT_DEVICE_REPORT_IDLE 8 | 72 | # define EVENT_DEVICE_REPORT_IDLE 8 |
72 | # define EVENT_NO_RUNTIME_PM 9 | 73 | # define EVENT_NO_RUNTIME_PM 9 |
74 | # define EVENT_RX_KILL 10 | ||
73 | }; | 75 | }; |
74 | 76 | ||
75 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 77 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
@@ -100,7 +102,6 @@ struct driver_info { | |||
100 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ | 102 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ |
101 | 103 | ||
102 | #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ | 104 | #define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */ |
103 | #define FLAG_NOARP 0x2000 /* device can't do ARP */ | ||
104 | 105 | ||
105 | /* | 106 | /* |
106 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. | 107 | * Indicates to usbnet, that USB driver accumulates multiple IP packets. |
@@ -108,6 +109,7 @@ struct driver_info { | |||
108 | */ | 109 | */ |
109 | #define FLAG_MULTI_PACKET 0x2000 | 110 | #define FLAG_MULTI_PACKET 0x2000 |
110 | #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ | 111 | #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ |
112 | #define FLAG_NOARP 0x8000 /* device can't do ARP */ | ||
111 | 113 | ||
112 | /* init device ... can sleep, or cause probe() failure */ | 114 | /* init device ... can sleep, or cause probe() failure */ |
113 | int (*bind)(struct usbnet *, struct usb_interface *); | 115 | int (*bind)(struct usbnet *, struct usb_interface *); |