mon_text.c (0612ec48762bf8712db1925b2e67246d2237ebab) mon_text.c (8e18e2941c53416aa219708e7dcad21fb4bd6794)
1/*
2 * The USB Monitor, inspired by Dave Harding's USBMon.
3 *
4 * This is a text format reader.
5 */
6
7#include <linux/kernel.h>
8#include <linux/list.h>

--- 224 unchanged lines hidden (view full) ---

233static int mon_text_open(struct inode *inode, struct file *file)
234{
235 struct mon_bus *mbus;
236 struct usb_bus *ubus;
237 struct mon_reader_text *rp;
238 int rc;
239
240 mutex_lock(&mon_lock);
1/*
2 * The USB Monitor, inspired by Dave Harding's USBMon.
3 *
4 * This is a text format reader.
5 */
6
7#include <linux/kernel.h>
8#include <linux/list.h>

--- 224 unchanged lines hidden (view full) ---

233static int mon_text_open(struct inode *inode, struct file *file)
234{
235 struct mon_bus *mbus;
236 struct usb_bus *ubus;
237 struct mon_reader_text *rp;
238 int rc;
239
240 mutex_lock(&mon_lock);
241 mbus = inode->u.generic_ip;
241 mbus = inode->i_private;
242 ubus = mbus->u_bus;
243
244 rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL);
245 if (rp == NULL) {
246 rc = -ENOMEM;
247 goto err_alloc;
248 }
249 INIT_LIST_HEAD(&rp->e_list);

--- 146 unchanged lines hidden (view full) ---

396{
397 struct mon_reader_text *rp = file->private_data;
398 struct mon_bus *mbus;
399 /* unsigned long flags; */
400 struct list_head *p;
401 struct mon_event_text *ep;
402
403 mutex_lock(&mon_lock);
242 ubus = mbus->u_bus;
243
244 rp = kzalloc(sizeof(struct mon_reader_text), GFP_KERNEL);
245 if (rp == NULL) {
246 rc = -ENOMEM;
247 goto err_alloc;
248 }
249 INIT_LIST_HEAD(&rp->e_list);

--- 146 unchanged lines hidden (view full) ---

396{
397 struct mon_reader_text *rp = file->private_data;
398 struct mon_bus *mbus;
399 /* unsigned long flags; */
400 struct list_head *p;
401 struct mon_event_text *ep;
402
403 mutex_lock(&mon_lock);
404 mbus = inode->u.generic_ip;
404 mbus = inode->i_private;
405
406 if (mbus->nreaders <= 0) {
407 printk(KERN_ERR TAG ": consistency error on close\n");
408 mutex_unlock(&mon_lock);
409 return 0;
410 }
411 mon_reader_del(mbus, &rp->r);
412

--- 48 unchanged lines hidden ---
405
406 if (mbus->nreaders <= 0) {
407 printk(KERN_ERR TAG ": consistency error on close\n");
408 mutex_unlock(&mon_lock);
409 return 0;
410 }
411 mon_reader_del(mbus, &rp->r);
412

--- 48 unchanged lines hidden ---