diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-27 18:16:47 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-27 18:16:47 -0400 |
commit | 3b9f6cb8a1ec791be79c6c7595fea922f12d1e64 (patch) | |
tree | 2393a448add846e6c2ed12f68106c3018b72c6a9 /drivers/usb/mon/mon_text.c | |
parent | c38778c3a9aeadcd1ee319cfc8ea5a9cbf8cdafa (diff) | |
parent | a77c64c1a641950626181b4857abb701d8f38ccc (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/usb/mon/mon_text.c')
-rw-r--r-- | drivers/usb/mon/mon_text.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/mon/mon_text.c b/drivers/usb/mon/mon_text.c index f961a770cee2..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 | ||
77 | static inline char mon_text_get_setup(struct mon_event_text *ep, | 77 | static 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 | ||
93 | static inline char mon_text_get_data(struct mon_event_text *ep, struct urb *urb, | 93 | static 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); |
@@ -238,7 +239,7 @@ static int mon_text_open(struct inode *inode, struct file *file) | |||
238 | int rc; | 239 | int rc; |
239 | 240 | ||
240 | mutex_lock(&mon_lock); | 241 | mutex_lock(&mon_lock); |
241 | mbus = inode->u.generic_ip; | 242 | mbus = inode->i_private; |
242 | ubus = mbus->u_bus; | 243 | ubus = mbus->u_bus; |
243 | 244 | ||
244 | rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL); | 245 | rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL); |
@@ -401,7 +402,7 @@ static int mon_text_release(struct inode *inode, struct file *file) | |||
401 | struct mon_event_text *ep; | 402 | struct mon_event_text *ep; |
402 | 403 | ||
403 | mutex_lock(&mon_lock); | 404 | mutex_lock(&mon_lock); |
404 | mbus = inode->u.generic_ip; | 405 | mbus = inode->i_private; |
405 | 406 | ||
406 | if (mbus->nreaders <= 0) { | 407 | if (mbus->nreaders <= 0) { |
407 | printk(KERN_ERR TAG ": consistency error on close\n"); | 408 | printk(KERN_ERR TAG ": consistency error on close\n"); |
@@ -435,7 +436,7 @@ static int mon_text_release(struct inode *inode, struct file *file) | |||
435 | return 0; | 436 | return 0; |
436 | } | 437 | } |
437 | 438 | ||
438 | struct file_operations mon_fops_text = { | 439 | const struct file_operations mon_fops_text = { |
439 | .owner = THIS_MODULE, | 440 | .owner = THIS_MODULE, |
440 | .open = mon_text_open, | 441 | .open = mon_text_open, |
441 | .llseek = no_llseek, | 442 | .llseek = no_llseek, |