Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
usbtmc.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/kref.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/usb.h>
#include <linux/usb/tmc.h>

Go to the source code of this file.

Data Structures

struct  usbtmc_dev_capabilities
 
struct  usbtmc_device_data
 

Macros

#define USBTMC_MINOR_BASE   176
 
#define USBTMC_SIZE_IOBUFFER   2048
 
#define USBTMC_TIMEOUT   5000
 
#define USBTMC_MAX_READS_TO_CLEAR_BULK_IN   100
 
#define to_usbtmc_data(d)   container_of(d, struct usbtmc_device_data, kref)
 
#define capability_attribute(name)
 
#define data_attribute(name)
 

Functions

 MODULE_DEVICE_TABLE (usb, usbtmc_devices)
 
 capability_attribute (interface_capabilities)
 
 capability_attribute (device_capabilities)
 
 capability_attribute (usb488_interface_capabilities)
 
 capability_attribute (usb488_device_capabilities)
 
 data_attribute (TermCharEnabled)
 
 data_attribute (auto_abort)
 
 module_usb_driver (usbtmc_driver)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define capability_attribute (   name)
Value:
static ssize_t show_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usbtmc_device_data *data = usb_get_intfdata(intf); \
\
return sprintf(buf, "%d\n", data->capabilities.name); \
} \
static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)

Definition at line 808 of file usbtmc.c.

#define data_attribute (   name)
Value:
static ssize_t show_##name(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usbtmc_device_data *data = usb_get_intfdata(intf); \
\
return sprintf(buf, "%d\n", data->name); \
} \
static ssize_t store_##name(struct device *dev, \
const char *buf, size_t count) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usbtmc_device_data *data = usb_get_intfdata(intf); \
unsigned val; \
\
result = sscanf(buf, "%u\n", &val); \
if (result != 1) \
result = -EINVAL; \
data->name = val; \
if (result < 0) \
return result; \
else \
return count; \
} \
static DEVICE_ATTR(name, S_IRUGO, show_##name, store_##name)

Definition at line 859 of file usbtmc.c.

#define to_usbtmc_data (   d)    container_of(d, struct usbtmc_device_data, kref)

Definition at line 98 of file usbtmc.c.

#define USBTMC_MAX_READS_TO_CLEAR_BULK_IN   100

Definition at line 50 of file usbtmc.c.

#define USBTMC_MINOR_BASE   176

drivers/usb/class/usbtmc.c - USB Test & Measurement class driver

Copyright (C) 2007 Stefan Kopp, Gechingen, Germany Copyright (C) 2008 Novell, Inc. Copyright (C) 2008 Greg Kroah-Hartman gregk.nosp@m.h@su.nosp@m.se.de

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The GNU General Public License is available at http://www.gnu.org/copyleft/gpl.html.

Definition at line 34 of file usbtmc.c.

#define USBTMC_SIZE_IOBUFFER   2048

Definition at line 40 of file usbtmc.c.

#define USBTMC_TIMEOUT   5000

Definition at line 43 of file usbtmc.c.

Function Documentation

capability_attribute ( interface_capabilities  )
capability_attribute ( device_capabilities  )
capability_attribute ( usb488_interface_capabilities  )
capability_attribute ( usb488_device_capabilities  )
data_attribute ( TermCharEnabled  )
data_attribute ( auto_abort  )
MODULE_DEVICE_TABLE ( usb  ,
usbtmc_devices   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( usbtmc_driver  )