/***************************************************************************/
/***************************************************************************/
/***************************************************************************/
/***************************************************************************/
#define COPYRIGHT "(c) 2005, 2006 Axis Communications AB"
#define DESCRIPTION "ETRAX 100LX USB Host Controller"
#define COPYRIGHT "(c) 2005, 2006 Axis Communications AB"
#define DESCRIPTION "ETRAX 100LX USB Host Controller"
/* We definitely don't care about these ones. Besides, they are
always disabled, so any possible disabling caused by the
epid attention interrupt is irrelevant. */
/* We definitely don't care about these ones. Besides, they are
always disabled, so any possible disabling caused by the
epid attention interrupt is irrelevant. */
/* Check the busy bit of USB controller in Etrax */
while((*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy)) &&
(timeout-- > 0));
/* Check the busy bit of USB controller in Etrax */
while((*R_USB_COMMAND & IO_MASK(R_USB_COMMAND, busy)) &&
(timeout-- > 0));
while((rh.wPortStatusPrev[port] &
IO_STATE(R_USB_RH_PORT_STATUS_1, enabled, yes)) &&
(timeout-- > 0));
while((rh.wPortStatusPrev[port] &
IO_STATE(R_USB_RH_PORT_STATUS_1, enabled, yes)) &&
(timeout-- > 0));
/* clear disable flag in special register */
*usb_portx_disable = IO_STATE(R_USB_PORT1_DISABLE, disable, no);
rh_info("Physical port %d disabled\n", port+1);
/* clear disable flag in special register */
*usb_portx_disable = IO_STATE(R_USB_PORT1_DISABLE, disable, no);
rh_info("Physical port %d disabled\n", port+1);
/* Ah, the luxury of busy-wait. */
while((*R_DMA_CH8_SUB3_EP == virt_to_phys(&TxIsocEPList[epid])) &&
(timeout-- > 0));
/* Ah, the luxury of busy-wait. */
while((*R_DMA_CH8_SUB3_EP == virt_to_phys(&TxIsocEPList[epid])) &&
(timeout-- > 0));
/* This will, among other things, set the valid field to 0. */
*R_USB_EPT_DATA = 0;
spin_unlock_irqrestore(&etrax_epid_lock, flags);
/* This will, among other things, set the valid field to 0. */
*R_USB_EPT_DATA = 0;
spin_unlock_irqrestore(&etrax_epid_lock, flags);
/* Wait until the DMA is no longer at this descriptor. */
while((*R_DMA_CH8_SUB2_EP == virt_to_phys(unlink_ep)) &&
(timeout-- > 0));
/* Wait until the DMA is no longer at this descriptor. */
while((*R_DMA_CH8_SUB2_EP == virt_to_phys(unlink_ep)) &&
(timeout-- > 0));