diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 19:54:53 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 20:01:40 (GMT) |
commit | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (patch) | |
tree | 3c2086ab67398a019089a47ca3f362a4bc6db74f /drivers/staging/et131x/et131x_adapter.h | |
parent | 34e84f39a27d059a3e6ec6e8b94aafa702e6f220 (diff) | |
parent | 9173a8ef24a6b1b8031507b35b8ffe5f85a87692 (diff) | |
download | linux-fsl-qoriq-ae19ffbadc1b2100285a5b5b3d0a4e0a11390904.tar.xz |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/staging/et131x/et131x_adapter.h')
-rw-r--r-- | drivers/staging/et131x/et131x_adapter.h | 141 |
1 files changed, 36 insertions, 105 deletions
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h index 36e61a4..1dfe06f 100644 --- a/drivers/staging/et131x/et131x_adapter.h +++ b/drivers/staging/et131x/et131x_adapter.h @@ -2,7 +2,7 @@ * Agere Systems Inc. * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs * - * Copyright © 2005 Agere Systems Inc. + * Copyright © 2005 Agere Systems Inc. * All rights reserved. * http://www.agere.com * @@ -20,7 +20,7 @@ * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * - * Copyright © 2005 Agere Systems Inc. + * Copyright © 2005 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without @@ -41,7 +41,7 @@ * * Disclaimer * - * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN @@ -67,7 +67,7 @@ * Do not change these values: if changed, then change also in respective * TXdma and Rxdma engines */ -#define NUM_DESC_PER_RING_TX 512 // TX Do not change these values +#define NUM_DESC_PER_RING_TX 512 /* TX Do not change these values */ #define NUM_TCB 64 /* @@ -100,28 +100,11 @@ #define LO_MARK_PERCENT_FOR_PSR 15 #define LO_MARK_PERCENT_FOR_RX 15 -/* Macros for flag and ref count operations */ -#define MP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F)) -#define MP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F)) -#define MP_CLEAR_FLAGS(_M) ((_M)->Flags = 0) -#define MP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0) -#define MP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F)) -#define MP_IS_FLAG_CLEAR(_M, _F) (((_M)->Flags & (_F)) == 0) - -#define MP_INC_RCV_REF(_A) atomic_inc(&(_A)->RcvRefCount) -#define MP_DEC_RCV_REF(_A) atomic_dec(&(_A)->RcvRefCount) -#define MP_GET_RCV_REF(_A) atomic_read(&(_A)->RcvRefCount) - /* Macros specific to the private adapter structure */ #define MP_TCB_RESOURCES_AVAILABLE(_M) ((_M)->TxRing.nBusySend < NUM_TCB) #define MP_TCB_RESOURCES_NOT_AVAILABLE(_M) ((_M)->TxRing.nBusySend >= NUM_TCB) #define MP_SHOULD_FAIL_SEND(_M) ((_M)->Flags & fMP_ADAPTER_FAIL_SEND_MASK) -#define MP_IS_NOT_READY(_M) ((_M)->Flags & fMP_ADAPTER_NOT_READY_MASK) -#define MP_IS_READY(_M) !((_M)->Flags & fMP_ADAPTER_NOT_READY_MASK) - -#define MP_HAS_CABLE(_M) !((_M)->Flags & fMP_ADAPTER_NO_CABLE) -#define MP_LINK_DETECTED(_M) !((_M)->Flags & fMP_ADAPTER_LINK_DETECTION) /* Counters for error rate monitoring */ typedef struct _MP_ERR_COUNTERS { @@ -136,9 +119,9 @@ typedef struct _MP_ERR_COUNTERS { typedef struct _MP_RFD { struct list_head list_node; struct sk_buff *Packet; - u32 PacketSize; // total size of receive frame - u16 iBufferIndex; - u8 iRingIndex; + u32 PacketSize; /* total size of receive frame */ + u16 bufferindex; + u8 ringindex; } MP_RFD, *PMP_RFD; /* Enum for Flow Control */ @@ -152,8 +135,8 @@ typedef enum _eflow_control_t { /* Struct to define some device statistics */ typedef struct _ce_stats_t { /* Link Input/Output stats */ - uint64_t ipackets; // # of in packets - uint64_t opackets; // # of out packets + uint64_t ipackets; /* # of in packets */ + uint64_t opackets; /* # of out packets */ /* MIB II variables * @@ -161,21 +144,21 @@ typedef struct _ce_stats_t { * MUST have 32, then we'll need another way to perform atomic * operations */ - u32 unircv; // # multicast packets received - atomic_t unixmt; // # multicast packets for Tx - u32 multircv; // # multicast packets received - atomic_t multixmt; // # multicast packets for Tx - u32 brdcstrcv; // # broadcast packets received - atomic_t brdcstxmt; // # broadcast packets for Tx - u32 norcvbuf; // # Rx packets discarded - u32 noxmtbuf; // # Tx packets discarded + u32 unircv; /* # multicast packets received */ + atomic_t unixmt; /* # multicast packets for Tx */ + u32 multircv; /* # multicast packets received */ + atomic_t multixmt; /* # multicast packets for Tx */ + u32 brdcstrcv; /* # broadcast packets received */ + atomic_t brdcstxmt; /* # broadcast packets for Tx */ + u32 norcvbuf; /* # Rx packets discarded */ + u32 noxmtbuf; /* # Tx packets discarded */ /* Transciever state informations. */ u8 xcvr_addr; u32 xcvr_id; /* Tx Statistics. */ - u32 tx_uflo; // Tx Underruns + u32 tx_uflo; /* Tx Underruns */ u32 collisions; u32 excessive_collisions; @@ -185,7 +168,7 @@ typedef struct _ce_stats_t { u32 tx_deferred; /* Rx Statistics. */ - u32 rx_ov_flow; // Rx Over Flow + u32 rx_ov_flow; /* Rx Over Flow */ u32 length_err; u32 alignment_err; @@ -193,15 +176,8 @@ typedef struct _ce_stats_t { u32 code_violations; u32 other_errors; -#ifdef CONFIG_ET131X_DEBUG - u32 UnhandledInterruptsPerSec; - u32 RxDmaInterruptsPerSec; - u32 TxDmaInterruptsPerSec; - u32 WatchDogInterruptsPerSec; -#endif /* CONFIG_ET131X_DEBUG */ - u32 SynchrounousIterations; - INTERRUPT_t InterruptStatus; + u32 InterruptStatus; } CE_STATS_t, *PCE_STATS_t; /* The private adapter structure */ @@ -218,8 +194,7 @@ struct et131x_adapter { /* Configuration */ u8 PermanentAddress[ETH_ALEN]; u8 CurrentAddress[ETH_ALEN]; - bool bOverrideAddress; - bool bEepromPresent; + bool has_eeprom; u8 eepromData[2]; /* Spinlocks */ @@ -238,11 +213,8 @@ struct et131x_adapter { /* Packet Filter and look ahead size */ u32 PacketFilter; - u32 ulLookAhead; - u32 uiLinkSpeed; - u32 uiDuplexMode; - u32 uiAutoNegStatus; - u8 ucLinkStatus; + u32 linkspeed; + u32 duplex_mode; /* multicast list */ u32 MCAddressCount; @@ -252,50 +224,24 @@ struct et131x_adapter { TXMAC_TXTEST_t TxMacTest; /* Pointer to the device's PCI register space */ - ADDRESS_MAP_t __iomem *CSRAddress; - - /* PCI config space info, for debug purposes only. */ - u8 RevisionID; - u16 VendorID; - u16 DeviceID; - u16 SubVendorID; - u16 SubSystemID; - u32 CacheFillSize; - u16 PciXDevCtl; - u8 pci_lat_timer; - u8 pci_hdr_type; - u8 pci_bist; - u32 pci_cfg_state[64 / sizeof(u32)]; + ADDRESS_MAP_t __iomem *regs; /* Registry parameters */ - u8 SpeedDuplex; // speed/duplex - eFLOW_CONTROL_t RegistryFlowControl; // for 802.3x flow control - u8 RegistryWOLMatch; // Enable WOL pattern-matching - u8 RegistryWOLLink; // Link state change is independant - u8 RegistryPhyComa; // Phy Coma mode enable/disable - - u32 RegistryRxMemEnd; // Size of internal rx memory - u8 RegistryMACStat; // If set, read MACSTAT, else don't - u32 RegistryVlanTag; // 802.1q Vlan TAG - u32 RegistryJumboPacket; // Max supported ethernet packet size + u8 SpeedDuplex; /* speed/duplex */ + eFLOW_CONTROL_t RegistryFlowControl; /* for 802.3x flow control */ + u8 RegistryPhyComa; /* Phy Coma mode enable/disable */ - u32 RegistryTxNumBuffers; - u32 RegistryTxTimeInterval; - - u32 RegistryRxNumBuffers; - u32 RegistryRxTimeInterval; + u32 RegistryRxMemEnd; /* Size of internal rx memory */ + u32 RegistryJumboPacket; /* Max supported ethernet packet size */ /* Validation helpers */ - u8 RegistryPMWOL; u8 RegistryNMIDisable; - u32 RegistryDMACache; - u32 RegistrySCGain; - u8 RegistryPhyLoopbk; // Enable Phy loopback + u8 RegistryPhyLoopbk; /* Enable Phy loopback */ /* Derived from the registry: */ - u8 AiForceDpx; // duplex setting - u16 AiForceSpeed; // 'Speed', user over-ride of line speed - eFLOW_CONTROL_t FlowControl; // flow control validated by the far-end + u8 AiForceDpx; /* duplex setting */ + u16 AiForceSpeed; /* 'Speed', user over-ride of line speed */ + eFLOW_CONTROL_t FlowControl; /* flow control validated by the far-end */ enum { NETIF_STATUS_INVALID = 0, NETIF_STATUS_MEDIA_CONNECT, @@ -305,15 +251,9 @@ struct et131x_adapter { u8 DriverNoPhyAccess; /* Minimize init-time */ - bool bQueryPending; - bool bSetPending; - bool bResetPending; struct timer_list ErrorTimer; - bool bLinkTimerActive; MP_POWER_MGMT PoMgmt; - INTERRUPT_t CachedMaskValue; - - atomic_t RcvRefCount; // Num packets not yet returned + u32 CachedMaskValue; /* Xcvr status at last poll */ MI_BMSR_t Bmsr; @@ -324,13 +264,9 @@ struct et131x_adapter { /* Rx Memory Variables */ RX_RING_t RxRing; - /* ET1310 register Access */ - JAGCORE_ACCESS_REGS JagCoreRegs; - PCI_CFG_SPACE_REGS PciCfgRegs; - /* Loopback specifics */ - u8 ReplicaPhyLoopbk; // Replica Enable - u8 ReplicaPhyLoopbkPF; // Replica Enable Pass/Fail + u8 ReplicaPhyLoopbk; /* Replica Enable */ + u8 ReplicaPhyLoopbkPF; /* Replica Enable Pass/Fail */ /* Stats */ CE_STATS_t Stats; @@ -339,9 +275,4 @@ struct et131x_adapter { struct net_device_stats net_stats_prev; }; -#define MPSendPacketsHandler MPSendPackets -#define MP_FREE_SEND_PACKET_FUN(Adapter, pMpTcb) \ - et131x_free_send_packet(Adapter, pMpTcb) -#define MpSendPacketFun(Adapter, Packet) MpSendPacket(Adapter, Packet) - #endif /* __ET131X_ADAPTER_H__ */ |