aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon/mon_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/mon/mon_text.c')
-rw-r--r--drivers/usb/mon/mon_text.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c
index 775e374a960c..7a2346c53284 100644
--- a/drivers/usb/mon/mon_text.c
+++ b/drivers/usb/mon/mon_text.c
@@ -75,13 +75,13 @@ static void mon_text_ctor(void *, kmem_cache_t *, unsigned long);
75 */ 75 */
76 76
77static inline char mon_text_get_setup(struct mon_event_text *ep, 77static inline char mon_text_get_setup(struct mon_event_text *ep,
78 struct urb *urb, char ev_type) 78 struct urb *urb, char ev_type, struct mon_bus *mbus)
79{ 79{
80 80
81 if (!usb_pipecontrol(urb->pipe) || ev_type != 'S') 81 if (!usb_pipecontrol(urb->pipe) || ev_type != 'S')
82 return '-'; 82 return '-';
83 83
84 if (urb->transfer_flags & URB_NO_SETUP_DMA_MAP) 84 if (mbus->uses_dma && (urb->transfer_flags & URB_NO_SETUP_DMA_MAP))
85 return mon_dmapeek(ep->setup, urb->setup_dma, SETUP_MAX); 85 return mon_dmapeek(ep->setup, urb->setup_dma, SETUP_MAX);
86 if (urb->setup_packet == NULL) 86 if (urb->setup_packet == NULL)
87 return 'Z'; /* '0' would be not as pretty. */ 87 return 'Z'; /* '0' would be not as pretty. */
@@ -91,7 +91,7 @@ static inline char mon_text_get_setup(struct mon_event_text *ep,
91} 91}
92 92
93static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb, 93static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb,
94 int len, char ev_type) 94 int len, char ev_type, struct mon_bus *mbus)
95{ 95{
96 int pipe = urb->pipe; 96 int pipe = urb->pipe;
97 97
@@ -117,7 +117,7 @@ static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb,
117 * contain non-NULL garbage in case the upper level promised to 117 * contain non-NULL garbage in case the upper level promised to
118 * set DMA for the HCD. 118 * set DMA for the HCD.
119 */ 119 */
120 if (urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP) 120 if (mbus->uses_dma && (urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP))
121 return mon_dmapeek(ep->data, urb->transfer_dma, len); 121 return mon_dmapeek(ep->data, urb->transfer_dma, len);
122 122
123 if (urb->transfer_buffer == NULL) 123 if (urb->transfer_buffer == NULL)
@@ -161,8 +161,9 @@ static void mon_text_event(struct mon_reader_text *rp, struct urb *urb,
161 /* Collecting status makes debugging sense for submits, too */ 161 /* Collecting status makes debugging sense for submits, too */
162 ep->status = urb->status; 162 ep->status = urb->status;
163 163
164 ep->setup_flag = mon_text_get_setup(ep, urb, ev_type); 164 ep->setup_flag = mon_text_get_setup(ep, urb, ev_type, rp->r.m_bus);
165 ep->data_flag = mon_text_get_data(ep, urb, ep->length, ev_type); 165 ep->data_flag = mon_text_get_data(ep, urb, ep->length, ev_type,
166 rp->r.m_bus);
166 167
167 rp->nevents++; 168 rp->nevents++;
168 list_add_tail(&ep->e_link, &rp->e_list); 169 list_add_tail(&ep->e_link, &rp->e_list);