Commit 1fa273f8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

merge of Randy's cpia fix over Davej's

parents c4f59ba5 a336ed51
......@@ -1720,7 +1720,7 @@ L: linux-usb-devel@lists.sourceforge.net
W: http://www.suse.cz/development/input/
S: Maintained
USB HUB
USB HUB DRIVER
P: Johannes Erdfelt
M: johannes@erdfelt.com
L: linux-usb-users@lists.sourceforge.net
......@@ -1863,13 +1863,12 @@ W: http://www.linux-usb.org
S: Supported
USB UHCI DRIVER
P: Georg Acher
M: usb@in.tum.de
P: Johannes Erdfelt
M: johannes@erdfelt.com
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
W: http://usb.in.tum.de
S: Maintained
USB "USBNET" DRIVER
P: David Brownell
M: dbrownell@users.sourceforge.net
......
......@@ -97,7 +97,7 @@ int dev_hotplug (struct device *dev, const char *action)
scratch += sprintf (scratch, "ACTION=%s", action) + 1;
envp [i++] = scratch;
scratch += sprintf (scratch, "DEVICE=%s", dev_path) + 1;
scratch += sprintf (scratch, "DEVPATH=%s", dev_path) + 1;
if (dev->bus->hotplug) {
/* have the bus specific function add its stuff */
......
......@@ -378,8 +378,8 @@ void cpia_unregister_camera(struct cam_data *cam);
/* ErrorCode */
#define ERROR_FLICKER_BELOW_MIN_EXP 0x01 /*flicker exposure got below minimum exposure */
#define ALOG(lineno,fmt,args...) printk(fmt,lineno,##args)
#define LOG(fmt,args...) ALOG((__LINE__),KERN_INFO __FILE__":%s(%d):"fmt, __FUNCTION__, ##args)
#define ALOG(fmt,args...) printk(fmt, ##args)
#define LOG(fmt,args...) ALOG(KERN_INFO __FILE__ ":%s(%d):" fmt, __FUNCTION__, __LINE__, ##args)
#ifdef _CPIA_DEBUG_
#define ADBG(lineno,fmt,args...) printk(fmt, jiffies, lineno, ##args)
......
......@@ -99,6 +99,34 @@ show_serial (struct device *dev, char *buf, size_t count, loff_t off)
}
static DEVICE_ATTR(serial,S_IRUGO,show_serial,NULL);
static ssize_t
show_speed (struct device *dev, char *buf, size_t count, loff_t off)
{
struct usb_device *udev;
char *speed;
if (off)
return 0;
udev = to_usb_device (dev);
switch (udev->speed) {
case USB_SPEED_LOW:
speed = "1.5";
break;
case USB_SPEED_UNKNOWN:
case USB_SPEED_FULL:
speed = "12";
break;
case USB_SPEED_HIGH:
speed = "480";
break;
default:
speed = "unknown";
}
return sprintf (buf, "%s\n", speed);
}
static DEVICE_ATTR(speed, S_IRUGO, show_speed, NULL);
/* Descriptor fields */
#define usb_descriptor_attr(field, format_string) \
static ssize_t \
......@@ -136,6 +164,7 @@ void usb_create_driverfs_dev_files (struct usb_device *udev)
device_create_file (dev, &dev_attr_bDeviceClass);
device_create_file (dev, &dev_attr_bDeviceSubClass);
device_create_file (dev, &dev_attr_bDeviceProtocol);
device_create_file (dev, &dev_attr_speed);
if (udev->descriptor.iManufacturer)
device_create_file (dev, &dev_attr_manufacturer);
......
......@@ -556,14 +556,6 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
*
* FIXME reduce hardwired intelligence here
*/
envp [i++] = scratch;
length += snprintf (scratch, buffer_size - length,
"%s", "DEVFS=/proc/bus/usb");
if ((buffer_size - length <= 0) || (i >= num_envp))
return -ENOMEM;
++length;
scratch += length;
envp [i++] = scratch;
length += snprintf (scratch, buffer_size - length,
"DEVICE=/proc/bus/usb/%03d/%03d",
......
This diff is collapsed.
......@@ -358,7 +358,7 @@ static void pl2303_set_termios (struct usb_serial_port *port, struct termios *ol
if (cflag & CRTSCTS) {
i = usb_control_msg (serial->dev, usb_sndctrlpipe (serial->dev, 0),
VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST_TYPE,
VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
0x0, 0x41, NULL, 0, 100);
dbg ("0x40:0x1:0x0:0x41 %d", i);
}
......
......@@ -421,4 +421,23 @@ extern int device_suspend(u32 state, u32 level);
extern void device_resume(u32 level);
extern void device_shutdown(void);
/* debugging and troubleshooting/diagnostic helpers. */
#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \
printk (KERN_DEBUG "%s %s: " format , \
dev.driver->name , dev.bus_id , ## arg)
#else
#define dev_dbg(dev, format, arg...) do {} while (0)
#endif
#define dev_err(dev, format, arg...) \
printk (KERN_ERR "%s %s: " format , \
dev.driver->name , dev.bus_id , ## arg)
#define dev_info(dev, format, arg...) \
printk (KERN_INFO "%s %s: " format , \
dev.driver->name , dev.bus_id , ## arg)
#define dev_warn(dev, format, arg...) \
printk (KERN_WARN "%s %s: " format , \
dev.driver->name , dev.bus_id , ## arg)
#endif /* _DEVICE_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment