void Wb35Tx_start(struct wbsoft_priv *adapter) { struct hw_data * pHwData = &adapter->sHwData; struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) { pWb35Tx->EP4vm_state = VM_RUNNING; Wb35Tx(adapter); } else atomic_dec(&pWb35Tx->TxFireCounter); }
static void Wb35Tx_complete(struct urb * pUrb) { struct wbsoft_priv *adapter = pUrb->context; struct hw_data * pHwData = &adapter->sHwData; struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; struct wb35_mds *pMds = &adapter->Mds; printk("wb35: tx complete\n"); pWb35Tx->EP4vm_state = VM_COMPLETED; pWb35Tx->EP4VM_status = pUrb->status; pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0; pWb35Tx->TxSendIndex++; pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER; if (pHwData->SurpriseRemove || pHwData->HwStop) goto error; if (pWb35Tx->tx_halt) goto error; if (pWb35Tx->EP4VM_status != 0) { printk("URB submission failed\n"); pWb35Tx->EP4vm_state = VM_STOP; goto error; } Mds_Tx(adapter); Wb35Tx(adapter); return; error: atomic_dec(&pWb35Tx->TxFireCounter); pWb35Tx->EP4vm_state = VM_STOP; }
static void Wb35Tx_complete(struct urb * pUrb) { struct wbsoft_priv *adapter = pUrb->context; struct hw_data * pHwData = &adapter->sHwData; struct wb35_tx *pWb35Tx = &pHwData->Wb35Tx; struct wb35_mds *pMds = &adapter->Mds; printk("wb35: tx complete\n"); // Variable setting pWb35Tx->EP4vm_state = VM_COMPLETED; pWb35Tx->EP4VM_status = pUrb->status; //Store the last result of Irp pMds->TxOwner[ pWb35Tx->TxSendIndex ] = 0;// Set the owner. Free the owner bit always. pWb35Tx->TxSendIndex++; pWb35Tx->TxSendIndex %= MAX_USB_TX_BUFFER_NUMBER; if (pHwData->SurpriseRemove) // Let WbWlanHalt to handle surprise remove goto error; if (pWb35Tx->tx_halt) goto error; // The URB is completed, check the result if (pWb35Tx->EP4VM_status != 0) { printk("URB submission failed\n"); pWb35Tx->EP4vm_state = VM_STOP; goto error; } Mds_Tx(adapter); Wb35Tx(adapter); return; error: atomic_dec(&pWb35Tx->TxFireCounter); pWb35Tx->EP4vm_state = VM_STOP; }