|
@@ -29,85 +29,102 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/)
|
|
|
}
|
|
|
|
|
|
switch (status) {
|
|
|
- /* success */
|
|
|
- case STATUS_SUCCESS:
|
|
|
- if ( urb->actual_length )
|
|
|
- {
|
|
|
-
|
|
|
- if(psIntfAdapter->ulInterruptData[1] & 0xFF)
|
|
|
- {
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "Got USIM interrupt");
|
|
|
+ /* success */
|
|
|
+ case STATUS_SUCCESS:
|
|
|
+ if (urb->actual_length) {
|
|
|
+
|
|
|
+ if (psIntfAdapter->ulInterruptData[1] & 0xFF) {
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
|
|
+ INTF_INIT, DBG_LVL_ALL,
|
|
|
+ "Got USIM interrupt");
|
|
|
}
|
|
|
|
|
|
- if(psIntfAdapter->ulInterruptData[1] & 0xFF00)
|
|
|
- {
|
|
|
+ if (psIntfAdapter->ulInterruptData[1] & 0xFF00) {
|
|
|
atomic_set(&Adapter->CurrNumFreeTxDesc,
|
|
|
- (psIntfAdapter->ulInterruptData[1] & 0xFF00) >> 8);
|
|
|
- atomic_set (&Adapter->uiMBupdate, TRUE);
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL, "TX mailbox contains %d",
|
|
|
+ (psIntfAdapter->ulInterruptData[1] &
|
|
|
+ 0xFF00) >> 8);
|
|
|
+ atomic_set(&Adapter->uiMBupdate, TRUE);
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
|
|
+ INTF_INIT, DBG_LVL_ALL,
|
|
|
+ "TX mailbox contains %d",
|
|
|
atomic_read(&Adapter->CurrNumFreeTxDesc));
|
|
|
}
|
|
|
- if(psIntfAdapter->ulInterruptData[1] >> 16)
|
|
|
- {
|
|
|
- Adapter->CurrNumRecvDescs=
|
|
|
+ if (psIntfAdapter->ulInterruptData[1] >> 16) {
|
|
|
+ Adapter->CurrNumRecvDescs =
|
|
|
(psIntfAdapter->ulInterruptData[1] >> 16);
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"RX mailbox contains %d",
|
|
|
- Adapter->CurrNumRecvDescs);
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS,
|
|
|
+ INTF_INIT, DBG_LVL_ALL,
|
|
|
+ "RX mailbox contains %d",
|
|
|
+ Adapter->CurrNumRecvDescs);
|
|
|
InterfaceRx(psIntfAdapter);
|
|
|
}
|
|
|
- if(Adapter->fw_download_done &&
|
|
|
+ if (Adapter->fw_download_done &&
|
|
|
!Adapter->downloadDDR &&
|
|
|
- atomic_read(&Adapter->CurrNumFreeTxDesc))
|
|
|
- {
|
|
|
- psIntfAdapter->psAdapter->downloadDDR +=1;
|
|
|
+ atomic_read(&Adapter->CurrNumFreeTxDesc)) {
|
|
|
+
|
|
|
+ psIntfAdapter->psAdapter->downloadDDR += 1;
|
|
|
wake_up(&Adapter->tx_packet_wait_queue);
|
|
|
}
|
|
|
- if(false == Adapter->waiting_to_fw_download_done)
|
|
|
- {
|
|
|
+ if (false == Adapter->waiting_to_fw_download_done) {
|
|
|
Adapter->waiting_to_fw_download_done = TRUE;
|
|
|
wake_up(&Adapter->ioctl_fw_dnld_wait_queue);
|
|
|
}
|
|
|
- if(!atomic_read(&Adapter->TxPktAvail))
|
|
|
- {
|
|
|
+ if (!atomic_read(&Adapter->TxPktAvail)) {
|
|
|
atomic_set(&Adapter->TxPktAvail, 1);
|
|
|
wake_up(&Adapter->tx_packet_wait_queue);
|
|
|
}
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Firing interrupt in URB");
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
|
|
|
+ DBG_LVL_ALL, "Firing interrupt in URB");
|
|
|
}
|
|
|
break;
|
|
|
- case -ENOENT :
|
|
|
- {
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"URB has got disconnected ....");
|
|
|
- return ;
|
|
|
- }
|
|
|
- case -EINPROGRESS:
|
|
|
- {
|
|
|
- //This situation may happened when URBunlink is used. for detail check usb_unlink_urb documentation.
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Impossibe condition has occurred... something very bad is going on");
|
|
|
- break ;
|
|
|
- //return;
|
|
|
- }
|
|
|
- case -EPIPE:
|
|
|
- {
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Interrupt IN endPoint has got halted/stalled...need to clear this");
|
|
|
- Adapter->bEndPointHalted = TRUE ;
|
|
|
- wake_up(&Adapter->tx_packet_wait_queue);
|
|
|
- urb->status = STATUS_SUCCESS ;
|
|
|
- return;
|
|
|
- }
|
|
|
- /* software-driven interface shutdown */
|
|
|
- case -ECONNRESET: //URB got unlinked.
|
|
|
- case -ESHUTDOWN: // hardware gone. this is the serious problem.
|
|
|
- //Occurs only when something happens with the host controller device
|
|
|
- case -ENODEV : //Device got removed
|
|
|
- case -EINVAL : //Some thing very bad happened with the URB. No description is available.
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"interrupt urb error %d", status);
|
|
|
- urb->status = STATUS_SUCCESS ;
|
|
|
- break ;
|
|
|
- //return;
|
|
|
- default:
|
|
|
- //This is required to check what is the defaults conditions when it occurs..
|
|
|
- BCM_DEBUG_PRINT(Adapter,DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,"GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...", status);
|
|
|
+ case -ENOENT:
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
|
|
|
+ DBG_LVL_ALL, "URB has got disconnected....");
|
|
|
+ return;
|
|
|
+ case -EINPROGRESS:
|
|
|
+ /*
|
|
|
+ * This situation may happened when URBunlink is used. for
|
|
|
+ * detail check usb_unlink_urb documentation.
|
|
|
+ */
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
|
|
|
+ DBG_LVL_ALL,
|
|
|
+ "Impossibe condition has occurred... something very bad is going on");
|
|
|
+ break;
|
|
|
+ /* return; */
|
|
|
+ case -EPIPE:
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
|
|
|
+ DBG_LVL_ALL,
|
|
|
+ "Interrupt IN endPoint has got halted/stalled...need to clear this");
|
|
|
+ Adapter->bEndPointHalted = TRUE;
|
|
|
+ wake_up(&Adapter->tx_packet_wait_queue);
|
|
|
+ urb->status = STATUS_SUCCESS;
|
|
|
+ return;
|
|
|
+ /* software-driven interface shutdown */
|
|
|
+ case -ECONNRESET: /* URB got unlinked */
|
|
|
+ case -ESHUTDOWN: /* hardware gone. this is the serious problem */
|
|
|
+ /*
|
|
|
+ * Occurs only when something happens with the
|
|
|
+ * host controller device
|
|
|
+ */
|
|
|
+ case -ENODEV: /* Device got removed */
|
|
|
+ case -EINVAL:
|
|
|
+ /*
|
|
|
+ * Some thing very bad happened with the URB. No
|
|
|
+ * description is available.
|
|
|
+ */
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, INTF_INIT,
|
|
|
+ DBG_LVL_ALL, "interrupt urb error %d", status);
|
|
|
+ urb->status = STATUS_SUCCESS;
|
|
|
+ break;
|
|
|
+ /* return; */
|
|
|
+ default:
|
|
|
+ /*
|
|
|
+ * This is required to check what is the defaults conditions
|
|
|
+ * when it occurs..
|
|
|
+ */
|
|
|
+ BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, NEXT_SEND, DBG_LVL_ALL,
|
|
|
+ "GOT DEFAULT INTERRUPT URB STATUS :%d..Please Analyze it...",
|
|
|
+ status);
|
|
|
break;
|
|
|
}
|
|
|
|