• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7800-V1.0.2.28/target/linux/lantiq/files/drivers/usb/ifxhcd/

Lines Matching refs:_ifxhcd

55 	static void dump_channel_info(ifxhcd_hcd_t *_ifxhcd, ifxhcd_epqh_t *_epqh);
63 void ifxhcd_complete_urb(ifxhcd_hcd_t *_ifxhcd, ifxhcd_urbd_t *_urbd, int _status)
69 //SPIN_LOCK_IRQSAVE(&_ifxhcd->lock, flags);
78 //SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
123 usb_hcd_unlink_urb_from_ep(ifxhcd_to_syshcd(_ifxhcd), urb);
124 SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
126 // usb_hcd_giveback_urb(ifxhcd_to_syshcd(_ifxhcd), urb);
127 usb_hcd_giveback_urb(ifxhcd_to_syshcd(_ifxhcd), urb, _status);
130 SPIN_LOCK_IRQSAVE(&_ifxhcd->lock, flags);
141 void defer_ifxhcd_complete_urb(ifxhcd_hcd_t *_ifxhcd, ifxhcd_urbd_t *_urbd, int _status)
147 list_move_tail(&_urbd->urbd_list_entry, &_ifxhcd->urbd_complete_list);
156 void kill_all_urbs_in_epqh(ifxhcd_hcd_t *_ifxhcd, ifxhcd_epqh_t *_epqh, int _status)
169 ifxhcd_complete_urb(_ifxhcd, urbd, _status);
179 void epqh_list_free(ifxhcd_hcd_t *_ifxhcd, struct list_head *_epqh_list)
193 kill_all_urbs_in_epqh(_ifxhcd, epqh, -ETIMEDOUT);
201 void epqh_list_free_all(ifxhcd_hcd_t *_ifxhcd)
206 SPIN_LOCK_IRQSAVE(&_ifxhcd->lock, flags);
208 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_np_active );
209 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_np_ready );
210 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_intr_active );
211 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_intr_ready );
213 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_isoc_active );
214 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_isoc_ready );
216 epqh_list_free(_ifxhcd, &_ifxhcd->epqh_stdby );
218 SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
226 int32_t ifxhcd_disconnect(ifxhcd_hcd_t *_ifxhcd)
228 IFX_DEBUGPL(DBG_HCDV, "%s(%p)\n", __func__, _ifxhcd);
231 _ifxhcd->flags.b.port_connect_status_change = 1;
232 _ifxhcd->flags.b.port_connect_status = 0;
244 ifxusb_mreg (&_ifxhcd->core_if.core_global_regs->gintmsk, intr.d32, 0);
245 ifxusb_mreg (&_ifxhcd->core_if.core_global_regs->gintsts, intr.d32, 0);
249 epqh_list_free_all(_ifxhcd);
259 num_channels = _ifxhcd->core_if.params.host_channels;
263 channel = &_ifxhcd->ifxhc[i];
266 hc_regs = _ifxhcd->core_if.hc_regs[i];
274 list_add_tail(&channel->hc_list_entry, &_ifxhcd->free_hc_list);
275 ifxhcd_hc_cleanup(&_ifxhcd->core_if, channel);
316 int ifxhcd_init(ifxhcd_hcd_t *_ifxhcd)
323 spin_lock_init(&_ifxhcd->lock);
325 hrtimer_init(&_ifxhcd->hr_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
326 _ifxhcd->hr_timer.function = ifxhcd_timer_func;
328 _ifxhcd->hc_driver.description = _ifxhcd->core_if.core_name;
329 _ifxhcd->hc_driver.product_desc = "IFX USB Controller";
330 //_ifxhcd->hc_driver.hcd_priv_size = sizeof(ifxhcd_hcd_t);
331 _ifxhcd->hc_driver.hcd_priv_size = sizeof(unsigned long);
332 _ifxhcd->hc_driver.irq = ifxhcd_irq;
333 _ifxhcd->hc_driver.flags = HCD_MEMORY | HCD_USB2;
334 _ifxhcd->hc_driver.start = ifxhcd_start;
335 _ifxhcd->hc_driver.stop = ifxhcd_stop;
336 //_ifxhcd->hc_driver.reset =
337 //_ifxhcd->hc_driver.suspend =
338 //_ifxhcd->hc_driver.resume =
339 _ifxhcd->hc_driver.urb_enqueue = ifxhcd_urb_enqueue;
340 _ifxhcd->hc_driver.urb_dequeue = ifxhcd_urb_dequeue;
341 _ifxhcd->hc_driver.endpoint_disable = ifxhcd_endpoint_disable;
342 _ifxhcd->hc_driver.get_frame_number = ifxhcd_get_frame_number;
343 _ifxhcd->hc_driver.hub_status_data = ifxhcd_hub_status_data;
344 _ifxhcd->hc_driver.hub_control = ifxhcd_hub_control;
345 //_ifxhcd->hc_driver.hub_suspend =
346 //_ifxhcd->hc_driver.hub_resume =
350 syshcd = usb_create_hcd(&_ifxhcd->hc_driver, _ifxhcd->dev, _ifxhcd->core_if.core_name);
352 syshcd = usb_create_hcd(&_ifxhcd->hc_driver, _ifxhcd->dev, _ifxhcd->dev->bus_id);
365 syshcd->rsrc_start = (unsigned long)_ifxhcd->core_if.core_global_regs;
366 syshcd->regs = (void *)_ifxhcd->core_if.core_global_regs;
369 //*((unsigned long *)(&(syshcd->hcd_priv)))=(unsigned long)_ifxhcd;
370 //*((unsigned long *)(&(syshcd->hcd_priv[0])))=(unsigned long)_ifxhcd;
371 syshcd->hcd_priv[0]=(unsigned long)_ifxhcd;
372 _ifxhcd->syshcd=syshcd;
374 INIT_LIST_HEAD(&_ifxhcd->epqh_np_active );
375 INIT_LIST_HEAD(&_ifxhcd->epqh_np_ready );
376 INIT_LIST_HEAD(&_ifxhcd->epqh_intr_active );
377 INIT_LIST_HEAD(&_ifxhcd->epqh_intr_ready );
379 INIT_LIST_HEAD(&_ifxhcd->epqh_isoc_active );
380 INIT_LIST_HEAD(&_ifxhcd->epqh_isoc_ready );
382 INIT_LIST_HEAD(&_ifxhcd->epqh_stdby );
383 INIT_LIST_HEAD(&_ifxhcd->urbd_complete_list);
389 INIT_LIST_HEAD(&_ifxhcd->free_hc_list);
391 int num_channels = _ifxhcd->core_if.params.host_channels;
395 _ifxhcd->ifxhc[i].hc_num = i;
401 if(_ifxhcd->dev->dma_mask)
402 *(_ifxhcd->dev->dma_mask) = ~0;
403 _ifxhcd->dev->coherent_dma_mask = ~0;
410 // retval = usb_add_hcd(syshcd, _ifxhcd->core_if.irq, SA_INTERRUPT|SA_SHIRQ);
411 retval = usb_add_hcd(syshcd, _ifxhcd->core_if.irq, IRQF_DISABLED | IRQF_SHARED );
421 _ifxhcd->status_buf = ifxusb_alloc_buf(IFXHCD_STATUS_BUF_SIZE, 1);
423 if (_ifxhcd->status_buf)
426 IFX_DEBUGPL(DBG_HCD, "IFX USB HCD Initialized, bus=%s, usbbus=%d\n", _ifxhcd->core_if.core_name, syshcd->self.busnum);
428 IFX_DEBUGPL(DBG_HCD, "IFX USB HCD Initialized, bus=%s, usbbus=%d\n", _ifxhcd->dev->bus_id, syshcd->self.busnum);
447 void ifxhcd_remove(ifxhcd_hcd_t *_ifxhcd)
449 struct usb_hcd *syshcd = ifxhcd_to_syshcd(_ifxhcd);
458 ifxusb_wreg (&_ifxhcd->core_if.core_global_regs->gintmsk, 0);
459 ifxusb_mreg (&_ifxhcd->core_if.core_global_regs->gahbcfg, 1, 0);
1294 \param _ifxhcd The HCD state structure.
1297 static int assign_and_init_hc(ifxhcd_hcd_t *_ifxhcd, ifxhcd_epqh_t *_epqh)
1303 IFX_DEBUGPL(DBG_HCDV, "%s(%p,%p)\n", __func__, _ifxhcd, _epqh);
1308 ifxhc = list_entry(_ifxhcd->free_hc_list.next, ifxhcd_hc_t, hc_list_entry);
1384 if (_ifxhcd->core_if.snpsid < 0x4f54271a && ifxhc->speed == IFXUSB_EP_SPEED_HIGH)
1401 ifxusb_hc_regs_t *hc_regs = _ifxhcd->core_if.hc_regs[hc_num];
1419 ifxusb_mreg(&_ifxhcd->core_if.host_global_regs->haintmsk, 0, intr_enable);
1426 ifxusb_mreg(&_ifxhcd->core_if.core_global_regs->gintmsk, 0, gintmsk.d32);
1542 static void select_eps_sub(ifxhcd_hcd_t *_ifxhcd)
1558 epqh_ptr = _ifxhcd->epqh_isoc_ready.next;
1559 while (epqh_ptr != &_ifxhcd->epqh_isoc_ready && !list_empty(&_ifxhcd->free_hc_list))
1565 if(assign_and_init_hc(_ifxhcd, epqh))
1568 list_move_tail(&epqh->epqh_list_entry, &_ifxhcd->epqh_isoc_active);
1577 epqh_ptr = _ifxhcd->epqh_intr_ready.next;
1578 while (epqh_ptr != &_ifxhcd->epqh_intr_ready && !list_empty(&_ifxhcd->free_hc_list))
1584 if(assign_and_init_hc(_ifxhcd, epqh))
1587 list_move_tail(&epqh->epqh_list_entry, &_ifxhcd->epqh_intr_active);
1595 epqh_ptr = _ifxhcd->epqh_np_ready.next;
1596 while (epqh_ptr != &_ifxhcd->epqh_np_ready && !list_empty(&_ifxhcd->free_hc_list)) // may need to preserve at lease one for period
1600 if(assign_and_init_hc(_ifxhcd, epqh))
1603 list_move_tail(&epqh->epqh_list_entry, &_ifxhcd->epqh_np_active);
1610 process_channels_sub(_ifxhcd);
1613 while (!list_empty(&_ifxhcd->urbd_complete_list))
1615 urbd_ptr = _ifxhcd->urbd_complete_list.next;
1620 ifxhcd_complete_urb(_ifxhcd, urbd, urbd->status);
1651 void select_eps(ifxhcd_hcd_t *_ifxhcd)
1655 if(!_ifxhcd->select_eps.func)
1657 _ifxhcd->select_eps.next = NULL;
1658 _ifxhcd->select_eps.state = 0;
1659 atomic_set( &_ifxhcd->select_eps.count, 0);
1660 _ifxhcd->select_eps.func = select_eps_func;
1661 _ifxhcd->select_eps.data = (unsigned long)_ifxhcd;
1663 tasklet_schedule(&_ifxhcd->select_eps);
1671 SPIN_LOCK_IRQSAVE(&_ifxhcd->lock, flags);
1673 /*if(_ifxhcd->select_eps_in_use){
1675 SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
1678 _ifxhcd->select_eps_in_use=1;
1681 select_eps_sub(_ifxhcd);
1683 //_ifxhcd->select_eps_in_use=0;
1685 SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
1783 void process_channels_sub(ifxhcd_hcd_t *_ifxhcd)
1790 if (!list_empty(&_ifxhcd->epqh_isoc_active))
1792 for (epqh_item = _ifxhcd->epqh_isoc_active.next;
1793 epqh_item != &_ifxhcd->epqh_isoc_active;
1809 ifxhcd_hc_start(&_ifxhcd->core_if, hc);
1814 ifxusb_mreg(&_ifxhcd->core_if.core_global_regs->gintmsk,0, gintsts.d32);
1822 if (!list_empty(&_ifxhcd->epqh_intr_active))
1824 for (epqh_item = _ifxhcd->epqh_intr_active.next;
1825 epqh_item != &_ifxhcd->epqh_intr_active;
1841 ifxhcd_hc_start(&_ifxhcd->core_if, hc);
1849 ifxusb_mreg(&_ifxhcd->core_if.core_global_regs->gintmsk,0, gintsts.d32);
1858 if (!list_empty(&_ifxhcd->epqh_np_active))
1860 for (epqh_item = _ifxhcd->epqh_np_active.next;
1861 epqh_item != &_ifxhcd->epqh_np_active;
1880 ifxhcd_hc_start(&_ifxhcd->core_if, hc);
1888 void process_channels(ifxhcd_hcd_t *_ifxhcd)
1894 SPIN_LOCK_IRQSAVE(&_ifxhcd->lock, flags);
1896 //if(_ifxhcd->process_channels_in_use)
1898 //_ifxhcd->process_channels_in_use=1;
1900 process_channels_sub(_ifxhcd);
1901 //_ifxhcd->process_channels_in_use=0;
1902 SPIN_UNLOCK_IRQRESTORE(&_ifxhcd->lock, flags);
2387 static void dump_channel_info(ifxhcd_hcd_t *_ifxhcd, ifxhcd_epqh_t *_epqh)
2402 hc_regs = _ifxhcd->core_if.hc_regs[hc->hc_num];
2422 list_for_each(item, &_ifxhcd->epqh_np_active)
2428 list_for_each(item, &_ifxhcd->epqh_np_ready)
2434 list_for_each(item, &_ifxhcd->epqh_intr_active)
2440 list_for_each(item, &_ifxhcd->epqh_intr_ready)
2447 list_for_each(item, &_ifxhcd->epqh_isoc_active)
2453 list_for_each(item, &_ifxhcd->epqh_isoc_ready)
2460 list_for_each(item, &_ifxhcd->epqh_stdby)
2482 void ifxhcd_dump_state(ifxhcd_hcd_t *_ifxhcd)
2486 num_channels = _ifxhcd->core_if.params.host_channels;
2492 ifxhcd_hc_t *hc = &_ifxhcd->ifxhc[i];