35 for (index = 0; index < nports; ++
index) {
37 n =
scnprintf(ptr, count,
"%d\n", index + 1);
52 const char *buf,
size_t count)
55 int portnum, new_owner;
59 if (
sscanf(buf,
"%d", &portnum) != 1)
72 set_owner(ehci, portnum, new_owner);
75 static DEVICE_ATTR(companion, 0644, show_companion, store_companion);
96 const char *buf,
size_t count)
100 unsigned frame, uframe;
101 unsigned short allocated_max;
106 if (
kstrtouint(buf, 0, &uframe_periodic_max) < 0)
109 if (uframe_periodic_max < 100 || uframe_periodic_max >= 125) {
110 ehci_info(ehci,
"rejecting invalid request for "
111 "uframe_periodic_max=%u\n", uframe_periodic_max);
128 if (uframe_periodic_max < ehci->uframe_periodic_max) {
132 for (uframe = 0; uframe < 7; ++uframe)
133 allocated_max =
max(allocated_max,
134 periodic_usecs (ehci, frame, uframe));
136 if (allocated_max > uframe_periodic_max) {
138 "cannot decrease uframe_periodic_max becase "
139 "periodic bandwidth is already allocated "
141 allocated_max, uframe_periodic_max);
148 ehci_info(ehci,
"setting max periodic bandwidth to %u%% "
149 "(== %u usec/uframe)\n",
150 100*uframe_periodic_max/125, uframe_periodic_max);
152 if (uframe_periodic_max != 100)
153 ehci_warn(ehci,
"max periodic bandwidth set is non-standard\n");
159 spin_unlock_irqrestore (&ehci->
lock, flags);
162 static DEVICE_ATTR(uframe_periodic_max, 0644, show_uframe_periodic_max, store_uframe_periodic_max);
165 static inline int create_sysfs_files(
struct ehci_hcd *ehci)
181 static inline void remove_sysfs_files(
struct ehci_hcd *ehci)
183 struct device *controller = ehci_to_hcd(ehci)->self.controller;