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

Go to the source code of this file.

Data Structures

struct  usb_led
 

Macros

#define DRIVER_AUTHOR   "Greg Kroah-Hartman, [email protected]"
 
#define DRIVER_DESC   "USB LED Driver"
 
#define show_set(value)
 

Enumerations

enum  led_type {
  LED_TYPE_RADIO, LED_TYPE_ASSOC, LED_TYPE_ACTIVITY, LED_TYPE_QUALITY,
  DELCOM_VISUAL_SIGNAL_INDICATOR, DREAM_CHEEKY_WEBMAIL_NOTIFIER
}
 

Functions

 MODULE_DEVICE_TABLE (usb, id_table)
 
 show_set (blue)
 
 show_set (red)
 
 show_set (green)
 
 module_usb_driver (led_driver)
 
 MODULE_AUTHOR (DRIVER_AUTHOR)
 
 MODULE_DESCRIPTION (DRIVER_DESC)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DRIVER_AUTHOR   "Greg Kroah-Hartman, [email protected]"

Definition at line 20 of file usbled.c.

#define DRIVER_DESC   "USB LED Driver"

Definition at line 21 of file usbled.c.

#define show_set (   value)
Value:
static ssize_t show_##value(struct device *dev, struct device_attribute *attr,\
char *buf) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_led *led = usb_get_intfdata(intf); \
\
return sprintf(buf, "%d\n", led->value); \
} \
static ssize_t set_##value(struct device *dev, struct device_attribute *attr,\
const char *buf, size_t count) \
{ \
struct usb_interface *intf = to_usb_interface(dev); \
struct usb_led *led = usb_get_intfdata(intf); \
int temp = simple_strtoul(buf, NULL, 10); \
\
led->value = temp; \
change_color(led); \
return count; \
} \
static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, show_##value, set_##value);

Definition at line 117 of file usbled.c.

Enumeration Type Documentation

enum led_type
Enumerator:
LED_TYPE_RADIO 
LED_TYPE_ASSOC 
LED_TYPE_ACTIVITY 
LED_TYPE_QUALITY 
DELCOM_VISUAL_SIGNAL_INDICATOR 
DREAM_CHEEKY_WEBMAIL_NOTIFIER 

Definition at line 23 of file usbled.c.

Function Documentation

MODULE_AUTHOR ( DRIVER_AUTHOR  )
MODULE_DESCRIPTION ( DRIVER_DESC  )
MODULE_DEVICE_TABLE ( usb  ,
id_table   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( led_driver  )
show_set ( blue  )
show_set ( red  )
show_set ( green  )