diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-10-30 14:14:36 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-01-06 21:51:48 (GMT) |
commit | 42c84bb4603d5a375b1c8dbbbef686d24e804807 (patch) | |
tree | e8ab2136a2e5a8f934108531edee0c088b02b8ac /drivers/staging/winbond/wb35tx.c | |
parent | cc18071068f518c3c01616d7900de3b77252ccdf (diff) | |
download | linux-fsl-qoriq-42c84bb4603d5a375b1c8dbbbef686d24e804807.tar.xz |
Staging: w35und: remove ->adapter from struct _HW_DATA_T
Eventually we want to pass a pointer to struct ieee80211_hw around in the
driver, so remove the bidirectional link between struct wb35_adapter and struct
_HW_DATA_T to simplify the code.
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/winbond/wb35tx.c')
-rw-r--r-- | drivers/staging/winbond/wb35tx.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/staging/winbond/wb35tx.c b/drivers/staging/winbond/wb35tx.c index af4a61f..ce7e981 100644 --- a/drivers/staging/winbond/wb35tx.c +++ b/drivers/staging/winbond/wb35tx.c @@ -23,23 +23,24 @@ Wb35Tx_get_tx_buffer(phw_data_t pHwData, u8 **pBuffer) return true; } -void Wb35Tx_start(phw_data_t pHwData) +void Wb35Tx_start(struct wb35_adapter *adapter) { + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; // Allow only one thread to run into function if (atomic_inc_return(&pWb35Tx->TxFireCounter) == 1) { pWb35Tx->EP4vm_state = VM_RUNNING; - Wb35Tx(pHwData); + Wb35Tx(adapter); } else atomic_dec(&pWb35Tx->TxFireCounter); } -void Wb35Tx(phw_data_t pHwData) +void Wb35Tx(struct wb35_adapter *adapter) { + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; - struct wb35_adapter *adapter = pHwData->adapter; u8 *pTxBufferAddress; PMDS pMds = &adapter->Mds; struct urb * pUrb = (struct urb *)pWb35Tx->Tx4Urb; @@ -65,7 +66,7 @@ void Wb35Tx(phw_data_t pHwData) usb_fill_bulk_urb(pUrb, pHwData->WbUsb.udev, usb_sndbulkpipe(pHwData->WbUsb.udev, 4), pTxBufferAddress, pMds->TxBufferSize[ SendIndex ], - Wb35Tx_complete, pHwData); + Wb35Tx_complete, adapter); pWb35Tx->EP4vm_state = VM_RUNNING; retv = usb_submit_urb(pUrb, GFP_ATOMIC); @@ -77,7 +78,7 @@ void Wb35Tx(phw_data_t pHwData) // Check if driver needs issue Irp for EP2 pWb35Tx->TxFillCount += pMds->TxCountInBuffer[SendIndex]; if (pWb35Tx->TxFillCount > 12) - Wb35Tx_EP2VM_start( pHwData ); + Wb35Tx_EP2VM_start(adapter); pWb35Tx->ByteTransfer += pMds->TxBufferSize[SendIndex]; return; @@ -90,8 +91,8 @@ void Wb35Tx(phw_data_t pHwData) void Wb35Tx_complete(struct urb * pUrb) { - phw_data_t pHwData = pUrb->context; - struct wb35_adapter *adapter = pHwData->adapter; + struct wb35_adapter *adapter = pUrb->context; + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; PMDS pMds = &adapter->Mds; @@ -117,7 +118,7 @@ void Wb35Tx_complete(struct urb * pUrb) } Mds_Tx(adapter); - Wb35Tx(pHwData); + Wb35Tx(adapter); return; error: @@ -193,8 +194,9 @@ void Wb35Tx_destroy(phw_data_t pHwData) #endif } -void Wb35Tx_CurrentTime(phw_data_t pHwData, u32 TimeCount) +void Wb35Tx_CurrentTime(struct wb35_adapter *adapter, u32 TimeCount) { + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; unsigned char Trigger = false; @@ -205,26 +207,28 @@ void Wb35Tx_CurrentTime(phw_data_t pHwData, u32 TimeCount) if (Trigger) { pWb35Tx->TxTimer = TimeCount; - Wb35Tx_EP2VM_start( pHwData ); + Wb35Tx_EP2VM_start(adapter); } } -void Wb35Tx_EP2VM_start(phw_data_t pHwData) +void Wb35Tx_EP2VM_start(struct wb35_adapter *adapter) { + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; // Allow only one thread to run into function if (atomic_inc_return(&pWb35Tx->TxResultCount) == 1) { pWb35Tx->EP2vm_state = VM_RUNNING; - Wb35Tx_EP2VM( pHwData ); + Wb35Tx_EP2VM(adapter); } else atomic_dec(&pWb35Tx->TxResultCount); } -void Wb35Tx_EP2VM(phw_data_t pHwData) +void Wb35Tx_EP2VM(struct wb35_adapter *adapter) { + phw_data_t pHwData = &adapter->sHwData; PWB35TX pWb35Tx = &pHwData->Wb35Tx; struct urb * pUrb = (struct urb *)pWb35Tx->Tx2Urb; u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; @@ -240,7 +244,7 @@ void Wb35Tx_EP2VM(phw_data_t pHwData) // Issuing URB // usb_fill_int_urb( pUrb, pHwData->WbUsb.udev, usb_rcvintpipe(pHwData->WbUsb.udev,2), - pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, pHwData, 32); + pltmp, MAX_INTERRUPT_LENGTH, Wb35Tx_EP2VM_complete, adapter, 32); pWb35Tx->EP2vm_state = VM_RUNNING; retv = usb_submit_urb(pUrb, GFP_ATOMIC); @@ -261,9 +265,9 @@ error: void Wb35Tx_EP2VM_complete(struct urb * pUrb) { - phw_data_t pHwData = pUrb->context; + struct wb35_adapter *adapter = pUrb->context; + phw_data_t pHwData = &adapter->sHwData; T02_DESCRIPTOR T02, TSTATUS; - struct wb35_adapter *adapter = pHwData->adapter; PWB35TX pWb35Tx = &pHwData->Wb35Tx; u32 * pltmp = (u32 *)pWb35Tx->EP2_buf; u32 i; |