aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2009-04-08 13:36:30 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-17 13:50:29 -0400
commitfca10c81d99ff9956179058460dfddc0418f3902 (patch)
treece940de5eb0b580d82cf3d9e4262a45bcc7f7598 /drivers
parent5936ac7f93965931c508e1928d142076998ce65d (diff)
WUSB: correct format of wusb_chid sysfs file
Make the wusb_chid sysfs file match the ABI documentation. Print all zeros if the WUSB host is stopped (instead of an empty file) and end the file with a newline. Signed-off-by: David Vrabel <david.vrabel@csr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/wusbcore/wusbhc.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/wusbcore/wusbhc.c b/drivers/usb/wusbcore/wusbhc.c
index 3638cc68529f..ee6256f23636 100644
--- a/drivers/usb/wusbcore/wusbhc.c
+++ b/drivers/usb/wusbcore/wusbhc.c
@@ -88,33 +88,31 @@ static DEVICE_ATTR(wusb_trust_timeout, 0644, wusb_trust_timeout_show,
88 wusb_trust_timeout_store); 88 wusb_trust_timeout_store);
89 89
90/* 90/*
91 * Show & store the current WUSB CHID 91 * Show the current WUSB CHID.
92 */ 92 */
93static ssize_t wusb_chid_show(struct device *dev, 93static ssize_t wusb_chid_show(struct device *dev,
94 struct device_attribute *attr, char *buf) 94 struct device_attribute *attr, char *buf)
95{ 95{
96 struct wusbhc *wusbhc = usbhc_dev_to_wusbhc(dev); 96 struct wusbhc *wusbhc = usbhc_dev_to_wusbhc(dev);
97 const struct wusb_ckhdid *chid;
97 ssize_t result = 0; 98 ssize_t result = 0;
98 99
99 if (wusbhc->wuie_host_info != NULL) 100 if (wusbhc->wuie_host_info != NULL)
100 result += ckhdid_printf(buf, PAGE_SIZE, 101 chid = &wusbhc->wuie_host_info->CHID;
101 &wusbhc->wuie_host_info->CHID); 102 else
103 chid = &wusb_ckhdid_zero;
104
105 result += ckhdid_printf(buf, PAGE_SIZE, chid);
106 result += sprintf(buf + result, "\n");
107
102 return result; 108 return result;
103} 109}
104 110
105/* 111/*
106 * Store a new CHID 112 * Store a new CHID.
107 *
108 * This will (FIXME) trigger many changes.
109 *
110 * - Send an all zeros CHID and it will stop the controller
111 * - Send a non-zero CHID and it will start it
112 * (unless it was started, it will just change the CHID,
113 * diconnecting all devices first).
114 * 113 *
115 * So first we scan the MMC we are sent and then we act on it. We 114 * - Write an all zeros CHID and it will stop the controller
116 * read it in the same format as we print it, an ASCII string of 16 115 * - Write a non-zero CHID and it will start it.
117 * hex bytes.
118 * 116 *
119 * See wusbhc_chid_set() for more info. 117 * See wusbhc_chid_set() for more info.
120 */ 118 */