• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/usb/wusbcore/

Lines Matching defs:wusbhc

3 #include "wusbhc.h"
20 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
22 * Supposedly we are the only thread accesing @wusbhc->port; in any
26 * @port_idx refers to the wusbhc's port index, not the USB port number
28 static int wusbhc_rh_port_reset(struct wusbhc *wusbhc, u8 port_idx)
31 struct wusb_port *port = wusb_port_by_idx(wusbhc, port_idx);
43 result = wusb_dev_update_address(wusbhc, wusb_dev);
58 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
72 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
77 size = wusbhc->ports_max + 1 /* hub bit */;
79 for (cnt = 0; cnt < wusbhc->ports_max; cnt++)
80 if (wusb_port_by_idx(wusbhc, cnt)->change)
93 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked
95 static int wusbhc_rh_get_hub_descr(struct wusbhc *wusbhc, u16 wValue,
100 u16 temp = 1 + (wusbhc->ports_max / 8);
107 descr->bNbrPorts = wusbhc->ports_max;
125 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
129 static int wusbhc_rh_clear_hub_feat(struct wusbhc *wusbhc, u16 feature)
147 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
151 static int wusbhc_rh_get_hub_status(struct wusbhc *wusbhc, u32 *buf,
161 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
163 static int wusbhc_rh_set_port_feat(struct wusbhc *wusbhc, u16 feature,
166 struct device *dev = wusbhc->dev;
168 if (port_idx > wusbhc->ports_max)
182 mutex_lock(&wusbhc->mutex);
183 wusb_port_by_idx(wusbhc, port_idx)->status |= USB_PORT_STAT_POWER;
184 mutex_unlock(&wusbhc->mutex);
187 return wusbhc_rh_port_reset(wusbhc, port_idx);
205 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
207 static int wusbhc_rh_clear_port_feat(struct wusbhc *wusbhc, u16 feature,
211 struct device *dev = wusbhc->dev;
213 if (port_idx > wusbhc->ports_max)
216 mutex_lock(&wusbhc->mutex);
223 wusb_port_by_idx(wusbhc, port_idx)->change &= ~USB_PORT_STAT_C_RESET;
226 wusb_port_by_idx(wusbhc, port_idx)->change &= ~USB_PORT_STAT_C_CONNECTION;
229 __wusbhc_dev_disable(wusbhc, port_idx);
232 wusb_port_by_idx(wusbhc, port_idx)->change &= ~USB_PORT_STAT_C_ENABLE;
246 mutex_unlock(&wusbhc->mutex);
254 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
256 static int wusbhc_rh_get_port_status(struct wusbhc *wusbhc, u16 port_idx,
261 if (port_idx > wusbhc->ports_max)
264 mutex_lock(&wusbhc->mutex);
265 buf[0] = cpu_to_le16(wusb_port_by_idx(wusbhc, port_idx)->status);
266 buf[1] = cpu_to_le16(wusb_port_by_idx(wusbhc, port_idx)->change);
267 mutex_unlock(&wusbhc->mutex);
275 * @wusbhc is assumed referenced and @wusbhc->mutex unlocked.
281 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
286 wusbhc, wValue, wIndex,
290 result = wusbhc_rh_clear_hub_feat(wusbhc, wValue);
293 result = wusbhc_rh_get_hub_status(wusbhc, (u32 *)buf, wLength);
297 result = wusbhc_rh_set_port_feat(wusbhc, wValue, wIndex >> 8,
301 result = wusbhc_rh_clear_port_feat(wusbhc, wValue, wIndex >> 8,
305 result = wusbhc_rh_get_port_status(wusbhc, wIndex - 1,
311 dev_err(wusbhc->dev, "%s (%p [%p], %x, %x, %x, %p, %x) "
312 "UNIMPLEMENTED\n", __func__, usb_hcd, wusbhc, reqntype,
323 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
324 dev_err(wusbhc->dev, "%s (%p [%p]) UNIMPLEMENTED\n", __func__,
325 usb_hcd, wusbhc);
333 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
334 dev_err(wusbhc->dev, "%s (%p [%p]) UNIMPLEMENTED\n", __func__,
335 usb_hcd, wusbhc);
343 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
344 dev_err(wusbhc->dev, "%s (%p [%p], port_idx %u) UNIMPLEMENTED\n",
345 __func__, usb_hcd, wusbhc, port_idx);
359 int wusbhc_rh_create(struct wusbhc *wusbhc)
363 port_size = wusbhc->ports_max * sizeof(wusbhc->port[0]);
364 wusbhc->port = kzalloc(port_size, GFP_KERNEL);
365 if (wusbhc->port == NULL)
367 for (itr = 0; itr < wusbhc->ports_max; itr++)
368 wusb_port_init(&wusbhc->port[itr]);
374 void wusbhc_rh_destroy(struct wusbhc *wusbhc)
376 kfree(wusbhc->port);