/* * The USB Monitor, inspired by Dave Harding's USBMon. * * This is the 's' or 'stat' reader which debugs usbmon itself. * Note that this code blows through locks, so make sure that * /dbg/usbmon/0s is well protected from non-root users. * */ #include #include #include #include #include #include #include "usb_mon.h" #define STAT_BUF_SIZE 80 struct snap { int slen; char str[STAT_BUF_SIZE]; }; static int mon_stat_open(struct inode *inode, struct file *file) { struct mon_bus *mbus; struct snap *sp; sp = kmalloc(sizeof(struct snap), GFP_KERNEL); if (sp == NULL) return -ENOMEM; mbus = inode->i_private; sp->slen = snprintf(sp->str, STAT_BUF_SIZE, "nreaders %d events %u text_lost %u\n", mbus->nreaders, mbus->cnt_events, mbus->cnt_text_lost); file->private_data = sp; return 0; } static ssize_t mon_stat_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { struct snap *sp = file->private_data; return simple_read_from_buffer(buf, nbytes, ppos, sp->str, sp->slen); } static int mon_stat_release(struct inode *inode, struct file *file) { struct snap *sp = file->private_data; file->private_data = NULL; kfree(sp); return 0; } const struct file_operations mon_fops_stat = { .owner = THIS_MODULE, .open = mon_stat_open, .llseek = no_llseek, .read = mon_stat_read, /* .write = mon_stat_write, */ /* .poll = mon_stat_poll, */ /* .unlocked_ioctl = mon_stat_ioctl, */ .release = mon_stat_release, }; git.cgi/linux/net-next.git/?h=nds-private-remove'>summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaju Lakkaraju <Raju.Lakkaraju@microsemi.com>2017-02-07 19:10:26 +0530
committerDavid S. Miller <davem@davemloft.net>2017-02-08 13:29:04 -0500
commit04d8a0a5f3b6887543850d991a5e37c4ec90e250 (patch)
treeee1fafb2122c2b29c7cb19e571bd7229afdbf847 /sound/sh/Makefile
parentff4cf0e5ce952488074aa7f47734af1794f55fbc (diff)
net: phy: Add LED mode driver for Microsemi PHYs.
LED Mode: Microsemi PHY support 2 LEDs (LED[0] and LED[1]) to display different status information that can be selected by setting LED mode. LED Mode parameter (vsc8531, led-0-mode) and (vsc8531, led-1-mode) get from Device Tree. Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'sound/sh/Makefile')