et1310: kill pAdapter in favour of a sane name
PATCH 1/3 et1310: kill pAdapter in favour of a sane name
---
drivers/staging/et131x/et1310_eeprom.c | 14 - drivers/staging/et131x/et1310_jagcore.c | 20 + drivers/staging/et131x/et1310_mac.c | 220 ++++++++------- drivers/staging/et131x/et1310_phy.c | 370 +++++++++++++------------- drivers/staging/et131x/et1310_pm.c | 46 ++- drivers/staging/et131x/et1310_rx.c | 202 +++++++------- drivers/staging/et131x/et1310_tx.c | 442 ++++++++++++++++--------------- drivers/staging/et131x/et131x_config.c | 90 +++--- drivers/staging/et131x/et131x_debug.c | 20 + drivers/staging/et131x/et131x_initpci.c | 82 +++--- drivers/staging/et131x/et131x_isr.c | 44 ++- drivers/staging/et131x/et131x_netdev.c | 38 +-- 12 files changed, 794 insertions(+), 794 deletions(-)
drivers/staging/et131x/et1310_eeprom.c +7 -7
@@ -143,7 +143,7 @@/** * EepromWriteByte - Write a byte to the ET1310's EEPROM -* @pAdapter: pointer to our private adapter structure +* @etdev: pointer to our private adapter structure * @unAddress: the address to write * @bData: the value to write * @unEepronId: the ID of the EEPROM
@@ -151,11 +151,11 @@* * Returns SUCCESS or FAILURE */ -int32_t EepromWriteByte (struct et131x_adapter *pAdapter,uint32_t unAddress, +int32_t EepromWriteByte (struct et131x_adapter *etdev,uint32_t unAddress,uint8_t bData,uint32_t unEepromId,uint32_t unAddressingMode) { -struct pci_dev *pdev = pAdapter->pdev; +struct pci_dev *pdev = etdev->pdev;int32_t nIndex;int32_t nRetries;int32_t nError = false;
@@ -292,7 +292,7 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,* so we do a blind write for load bug. */ if (bStatus &LBCIF_STATUS_GENERAL_ERROR - && pAdapter->RevisionID ==0 ) { + && etdev->RevisionID ==0 ) {break ; }
@@ -349,7 +349,7 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,/** * EepromReadByte - Read a byte from the ET1310's EEPROM -* @pAdapter: pointer to our private adapter structure +* @etdev: pointer to our private adapter structure * @unAddress: the address from which to read * @pbData: a pointer to a byte in which to store the value of the read * @unEepronId: the ID of the EEPROM
@@ -357,11 +357,11 @@ int32_t EepromWriteByte(struct et131x_adapter *pAdapter, uint32_t unAddress,* * Returns SUCCESS or FAILURE */ -int32_t EepromReadByte (struct et131x_adapter *pAdapter,uint32_t unAddress, +int32_t EepromReadByte (struct et131x_adapter *etdev,uint32_t unAddress,uint8_t *pbData,uint32_t unEepromId,uint32_t unAddressingMode) { -struct pci_dev *pdev = pAdapter->pdev; +struct pci_dev *pdev = etdev->pdev;int32_t nIndex;int32_t nError =0 ;uint8_t bControl;
drivers/staging/et131x/et1310_jagcore.c +10 -10
@@ -99,27 +99,27 @@ extern dbg_info_t *et131x_dbginfo;* ConfigGlobalRegs - Used to configure the global registers on the JAGCore * @pAdpater: pointer to our adapter structure */ -void ConfigGlobalRegs (struct et131x_adapter *pAdapter) +void ConfigGlobalRegs (struct et131x_adapter *etdev) { -struct _GLOBAL_t __iomem *pGbl = &pAdapter->CSRAddress->global; +struct _GLOBAL_t __iomem *pGbl = &etdev->CSRAddress->global;DBG_ENTER (et131x_dbginfo); -if (pAdapter->RegistryPhyLoopbk == false) { -if (pAdapter->RegistryJumboPacket <2048 ) { +if (etdev->RegistryPhyLoopbk == false) { +if (etdev->RegistryJumboPacket <2048 ) {/* Tx / RxDMA and Tx/Rx MAC interfaces have a 1k word * block of RAM that the driver can split between Tx * and Rx as it desires. Our default is to split it * 50/50: */ writel (0 , &pGbl->rxq_start_addr.value); -writel (pAdapter->RegistryRxMemEnd, +writel (etdev->RegistryRxMemEnd, &pGbl->rxq_end_addr.value); -writel (pAdapter->RegistryRxMemEnd +1 , +writel (etdev->RegistryRxMemEnd +1 , &pGbl->txq_start_addr.value);writel (INTERNAL_MEM_SIZE -1 , &pGbl->txq_end_addr.value); - }else if (pAdapter->RegistryJumboPacket <8192 ) { + }else if (etdev->RegistryJumboPacket <8192 ) {/* For jumbo packets > 2k but < 8k, split 50-50. */ writel (0 , &pGbl->rxq_start_addr.value); writel(INTERNAL_MEM_RX_OFFSET,
@@ -171,9 +171,9 @@ void ConfigGlobalRegs(struct et131x_adapter *pAdapter)/** * ConfigMMCRegs - Used to configure the main memory registers in the JAGCore -* @pAdapter: pointer to our adapter structure +* @etdev: pointer to our adapter structure */ -void ConfigMMCRegs (struct et131x_adapter *pAdapter) +void ConfigMMCRegs (struct et131x_adapter *etdev) {MMC_CTRL_t mmc_ctrl = {0 };
@@ -188,7 +188,7 @@ void ConfigMMCRegs(struct et131x_adapter *pAdapter) mmc_ctrl.bits.arb_disable =0x0 ; mmc_ctrl.bits.mmc_enable =0x1 ; -writel (mmc_ctrl.value, &pAdapter->CSRAddress->mmc.mmc_ctrl.value); +writel (mmc_ctrl.value, &etdev->CSRAddress->mmc.mmc_ctrl.value);DBG_LEAVE (et131x_dbginfo); }
drivers/staging/et131x/et1310_mac.c +110 -110
460 lines not on this page · raw message
drivers/staging/et131x/et1310_phy.c +185 -185
798 lines not on this page · raw message
drivers/staging/et131x/et1310_pm.c +23 -23
118 lines not on this page · raw message
drivers/staging/et131x/et1310_rx.c +101 -101
506 lines not on this page · raw message
drivers/staging/et131x/et1310_tx.c +221 -221
1,015 lines not on this page · raw message
drivers/staging/et131x/et131x_config.c +45 -45
90 lines not on this page · raw message
drivers/staging/et131x/et131x_debug.c +10 -10
Lines of this file are not shown. View the raw message.
drivers/staging/et131x/et131x_initpci.c +41 -41
82 lines not on this page · raw message
drivers/staging/et131x/et131x_isr.c +22 -22
44 lines not on this page · raw message
drivers/staging/et131x/et131x_netdev.c +19 -19
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 2/3 et131x: spinlocks
Switch to the more normal "flags" naming. Also fix up the nested use of spin_lock_irqsave
---
drivers/staging/et131x/et1310_phy.c | 10 ++-- drivers/staging/et131x/et1310_pm.c | 6 +-- drivers/staging/et131x/et1310_rx.c | 28 ++++++------ drivers/staging/et131x/et1310_tx.c | 74 ++++++++++++++++--------------- drivers/staging/et131x/et131x_initpci.c | 6 +-- drivers/staging/et131x/et131x_netdev.c | 14 +++--- 6 files changed, 69 insertions(+), 69 deletions(-)
drivers/staging/et131x/et1310_phy.c +5 -5
@@ -484,7 +484,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,uint32_t uiMdiMdix;uint32_t uiMasterSlave;uint32_t uiPolarity; -unsigned long lockflags; +unsigned long flags;DBG_ENTER (et131x_dbginfo);
@@ -495,12 +495,12 @@ void et131x_Mii_check(struct et131x_adapter *etdev,/* Update our state variables and indicate the * connected state */ -spin_lock_irqsave (&etdev->Lock, lockflags); +spin_lock_irqsave (&etdev->Lock, flags); etdev->MediaState =NETIF_STATUS_MEDIA_CONNECT ;MP_CLEAR_FLAG (etdev, fMP_ADAPTER_LINK_DETECTION); -spin_unlock_irqrestore (&etdev->Lock, lockflags); +spin_unlock_irqrestore (&etdev->Lock, flags);/* Don't indicate state if we're in loopback mode */ if (etdev->RegistryPhyLoopbk == false)
@@ -533,11 +533,11 @@ void et131x_Mii_check(struct et131x_adapter *etdev, (etdev, fMP_ADAPTER_LINK_DETECTION)) || (etdev->MediaState == NETIF_STATUS_MEDIA_DISCONNECT)) { -spin_lock_irqsave (&etdev->Lock, lockflags); +spin_lock_irqsave (&etdev->Lock, flags); etdev->MediaState =NETIF_STATUS_MEDIA_DISCONNECT ;spin_unlock_irqrestore (&etdev->Lock, - lockflags); + flags);/* Only indicate state if we're in loopback * mode
drivers/staging/et131x/et1310_pm.c +3 -3
@@ -119,7 +119,7 @@ extern dbg_info_t *et131x_dbginfo;*/ void EnablePhyComa (struct et131x_adapter *etdev) { -unsigned long lockflags; +unsigned long flags;PM_CSR_t GlobalPmCSR;int32_t LoopCounter =10 ;
@@ -134,9 +134,9 @@ void EnablePhyComa(struct et131x_adapter *etdev) etdev->PoMgmt.PowerDownDuplex = etdev->AiForceDpx;/* Stop sending packets. */ -spin_lock_irqsave (&etdev->SendHWLock, lockflags); +spin_lock_irqsave (&etdev->SendHWLock, flags);MP_SET_FLAG (etdev, fMP_ADAPTER_LOWER_POWER); -spin_unlock_irqrestore (&etdev->SendHWLock, lockflags); +spin_unlock_irqrestore (&etdev->SendHWLock, flags);/* Wait for outstanding Receive packets */ while ((MP_GET_RCV_REF (etdev) !=0 ) && (LoopCounter-- >0 ))
drivers/staging/et131x/et1310_rx.c +14 -14
@@ -685,7 +685,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)PFBR_DESC_t pFbrEntry;uint32_t iEntry;RXDMA_PSR_NUM_DES_t psr_num_des; -unsigned long lockflags; +unsigned long flags;DBG_ENTER (et131x_dbginfo);
@@ -718,7 +718,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)writel ((psr_num_des.bits.psr_ndes *LO_MARK_PERCENT_FOR_PSR ) /100 , &pRxDma->psr_min_des.value); -spin_lock_irqsave (&etdev->RcvLock, lockflags); +spin_lock_irqsave (&etdev->RcvLock, flags);/* These local variables track the PSR in the adapter structure */ pRxLocal->local_psr_full.bits.psr_full =0 ;
@@ -801,7 +801,7 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)*/ writel (etdev->RegistryRxTimeInterval, &pRxDma->max_pkt_time.value); -spin_unlock_irqrestore (&etdev->RcvLock, lockflags); +spin_unlock_irqrestore (&etdev->RcvLock, flags);DBG_LEAVE (et131x_dbginfo); }
@@ -914,7 +914,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)PMP_RFD pMpRfd;uint32_t nIndex;uint8_t *pBufVa; -unsigned long lockflags; +unsigned long flags;struct list_head *element;uint8_t ringIndex;uint16_t bufferIndex;
@@ -1013,7 +1013,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) }/* Get and fill the RFD. */ -spin_lock_irqsave (&etdev->RcvLock, lockflags); +spin_lock_irqsave (&etdev->RcvLock, flags); pMpRfd =NULL ; element = pRxLocal->RecvList.next;
@@ -1023,14 +1023,14 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)DBG_RX (et131x_dbginfo,"NULL RFD returned from RecvList via list_entry()\n" );DBG_RX_LEAVE (et131x_dbginfo); -spin_unlock_irqrestore (&etdev->RcvLock, lockflags); +spin_unlock_irqrestore (&etdev->RcvLock, flags);return NULL ; }list_del (&pMpRfd->list_node); pRxLocal->nReadyRecv--; -spin_unlock_irqrestore (&etdev->RcvLock, lockflags); +spin_unlock_irqrestore (&etdev->RcvLock, flags); pMpRfd->iBufferIndex = bufferIndex; pMpRfd->iRingIndex = ringIndex;
@@ -1260,9 +1260,9 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)* Besides, we don't really need (at this point) the * pending list anyway. */ -/* spin_lock_irqsave( &etdev->RcvPendLock, lockflags ); +/* spin_lock_irqsave( &etdev->RcvPendLock, flags ); * list_add_tail( &pMpRfd->list_node, &etdev->RxRing.RecvPendingList ); -* spin_unlock_irqrestore( &etdev->RcvPendLock, lockflags ); +* spin_unlock_irqrestore( &etdev->RcvPendLock, flags ); */ /* Update the number of outstanding Recvs */
@@ -1302,7 +1302,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)struct _RXDMA_t __iomem *pRxDma = &etdev->CSRAddress->rxdma;uint16_t bi = pMpRfd->iBufferIndex;uint8_t ri = pMpRfd->iRingIndex; -unsigned long lockflags; +unsigned long flags;DBG_RX_ENTER (et131x_dbginfo);
@@ -1314,7 +1314,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) (ri == 0 && bi < pRxLocal->Fbr0NumEntries) || #endif (ri == 1 && bi < pRxLocal->Fbr1NumEntries)) { -spin_lock_irqsave (&etdev->FbrLock, lockflags); +spin_lock_irqsave (&etdev->FbrLock, flags);if (ri ==1 ) { PFBR_DESC_t pNextDesc =
@@ -1362,7 +1362,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd) &pRxDma->fbr0_full_offset.value); }#endif -spin_unlock_irqrestore (&etdev->FbrLock, lockflags); +spin_unlock_irqrestore (&etdev->FbrLock, flags); }else {DBG_ERROR (et131x_dbginfo,"NICReturnRFD illegal Buffer Index returned\n" );
@@ -1371,10 +1371,10 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)/* The processing on this RFD is done, so put it back on the tail of * our list */ -spin_lock_irqsave (&etdev->RcvLock, lockflags); +spin_lock_irqsave (&etdev->RcvLock, flags);list_add_tail (&pMpRfd->list_node, &pRxLocal->RecvList); pRxLocal->nReadyRecv++; -spin_unlock_irqrestore (&etdev->RcvLock, lockflags); +spin_unlock_irqrestore (&etdev->RcvLock, flags);DBG_ASSERT (pRxLocal->nReadyRecv <= pRxLocal->NumRfd);DBG_RX_LEAVE (et131x_dbginfo);
drivers/staging/et131x/et1310_tx.c +37 -37
272 lines not on this page · raw message
drivers/staging/et131x/et131x_initpci.c +3 -3
@@ -492,18 +492,18 @@ void et131x_error_timer_handler(unsigned long data)void et131x_link_detection_handler (unsigned long data) {struct et131x_adapter *etdev = (struct et131x_adapter *) data; -unsigned long lockflags; +unsigned long flags;/* Let everyone know that we have run */ etdev->bLinkTimerActive = false;if (etdev->MediaState ==0 ) { -spin_lock_irqsave (&etdev->Lock, lockflags); +spin_lock_irqsave (&etdev->Lock, flags); etdev->MediaState =NETIF_STATUS_MEDIA_DISCONNECT ;MP_CLEAR_FLAG (etdev, fMP_ADAPTER_LINK_DETECTION); -spin_unlock_irqrestore (&etdev->Lock, lockflags); +spin_unlock_irqrestore (&etdev->Lock, flags);netif_carrier_off (etdev->netdev);
drivers/staging/et131x/et131x_netdev.c +7 -7
@@ -467,12 +467,12 @@ void et131x_multicast(struct net_device *netdev)struct et131x_adapter *adapter =netdev_priv (netdev);uint32_t PacketFilter =0 ;uint32_t count; -unsigned long lockflags; +unsigned long flags;struct dev_mc_list *mclist = netdev->mc_list;DBG_ENTER (et131x_dbginfo); -spin_lock_irqsave (&adapter->Lock, lockflags); +spin_lock_irqsave (&adapter->Lock, flags);/* Before we modify the platform-independent filter flags, store them * locally. This allows us to determine if anything's changed and if
@@ -552,7 +552,7 @@ void et131x_multicast(struct net_device *netdev) "NO UPDATE REQUIRED, FLAGS didn't change\n"); } -spin_unlock_irqrestore (&adapter->Lock, lockflags); +spin_unlock_irqrestore (&adapter->Lock, flags);DBG_LEAVE (et131x_dbginfo); }
@@ -610,7 +610,7 @@ void et131x_tx_timeout(struct net_device *netdev) {struct et131x_adapter *etdev =netdev_priv (netdev);PMP_TCB pMpTcb; -unsigned long lockflags; +unsigned long flags;DBG_WARNING (et131x_dbginfo,"TX TIMEOUT\n" );
@@ -635,7 +635,7 @@ void et131x_tx_timeout(struct net_device *netdev) }/* Is send stuck? */ -spin_lock_irqsave (&etdev->TCBSendQLock, lockflags); +spin_lock_irqsave (&etdev->TCBSendQLock, flags); pMpTcb = etdev->TxRing.CurrSendHead;
@@ -660,7 +660,7 @@ void et131x_tx_timeout(struct net_device *netdev) }spin_unlock_irqrestore (&etdev->TCBSendQLock, - lockflags); + flags); DBG_WARNING(et131x_dbginfo, "Send stuck - reset. pMpTcb->WrIndex %x, Flags 0x%08x\n",
@@ -689,7 +689,7 @@ void et131x_tx_timeout(struct net_device *netdev) } } -spin_unlock_irqrestore (&etdev->TCBSendQLock, lockflags); +spin_unlock_irqrestore (&etdev->TCBSendQLock, flags); }/**
PATCH 3/3 et131x: power state
In reply to Alan CoxThis is assigned once to ndis d0, and then never changes so it is a constant and we can zap it
---
drivers/staging/et131x/et1310_pm.h | 10 ---------- drivers/staging/et131x/et1310_rx.c | 2 -- drivers/staging/et131x/et131x_initpci.c | 2 -- drivers/staging/et131x/et131x_isr.c | 3 +-- 4 files changed, 1 insertions(+), 16 deletions(-)
drivers/staging/et131x/et1310_pm.h +0 -10
@@ -66,15 +66,6 @@#define NUM_WOL_PATTERNS 0x5#define CRC16_POLY 0x1021 -/* Definition of NDIS_DEVICE_POWER_STATE */ -typedef enum { - NdisDeviceStateUnspecified =0 , - NdisDeviceStateD0, - NdisDeviceStateD1, - NdisDeviceStateD2, - NdisDeviceStateD3 -}NDIS_DEVICE_POWER_STATE ; - typedef struct _MP_POWER_MGMT { /* variable putting the phy into coma mode when boot up with no cable * plugged in after 5 seconds
@@ -97,7 +88,6 @@ typedef struct _MP_POWER_MGMT { } IPAddress;/* Current Power state of the adapter. */ -NDIS_DEVICE_POWER_STATE PowerState;bool WOLState;bool WOLEnabled;bool Failed10Half;
drivers/staging/et131x/et1310_rx.c +0 -2
@@ -1235,13 +1235,11 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)break ;/* Do not receive any packets until a filter has been set. -* Do not receive any packets until we are at D0. * Do not receive any packets until we have link. * If length is zero, return the RFD in order to advance the * Free buffer ring. */ if ((!etdev->PacketFilter) || - (etdev->PoMgmt.PowerState != NdisDeviceStateD0) || (!MP_LINK_DETECTED (etdev)) || (pMpRfd->PacketSize ==0 )) {continue ;
drivers/staging/et131x/et131x_initpci.c +0 -2
@@ -967,8 +967,6 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev,DBG_TRACE (et131x_dbginfo,"Init send data structures...\n" );et131x_init_send (adapter); - adapter->PoMgmt.PowerState = NdisDeviceStateD0; -/* Register the interrupt * * NOTE - This is being done in the open routine, where most other
drivers/staging/et131x/et131x_isr.c +1 -2
@@ -479,6 +479,5 @@ void et131x_isr_handler(struct work_struct *work) } } -if (etdev->PoMgmt.PowerState == NdisDeviceStateD0) -et131x_enable_interrupts (etdev); +et131x_enable_interrupts (etdev); }