*/
#define NUM_TRAFFIC_CLASSES 1
-/*
- * There are three ways of counting errors - if there are more than X errors
- * in Y packets (represented by the "SAMPLE" macros), if there are more than
- * N errors in a S mSec time period (the "PERIOD" macros), or if there are
- * consecutive packets with errors (CONSEC_ERRORED_THRESH). This last covers
- * for "Bursty" errors, and the errored packets may well not be contiguous,
- * but several errors where the packet counter has changed by less than a
- * small amount will cause this count to increment.
- */
-#define TX_PACKETS_IN_SAMPLE 10000
-#define TX_MAX_ERRORS_IN_SAMPLE 50
-
#define TX_ERROR_PERIOD 1000
-#define TX_MAX_ERRORS_IN_PERIOD 10
-
-#define LINK_DETECTION_TIMER 5000
-
-#define TX_CONSEC_RANGE 5
-#define TX_CONSEC_ERRORED_THRESH 10
#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)
-
-/* 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 {
- u32 PktCountTxPackets;
- u32 PktCountTxErrors;
- u32 TimerBasedTxErrors;
- u32 PktCountLastError;
- u32 ErredConsecPackets;
-} MP_ERR_COUNTERS, *PMP_ERR_COUNTERS;
-
/* RFD (Receive Frame Descriptor) */
typedef struct _MP_RFD {
struct list_head list_node;
struct sk_buff *Packet;
u32 PacketSize; /* total size of receive frame */
- u16 iBufferIndex;
- u8 iRingIndex;
+ u16 bufferindex;
+ u8 ringindex;
} MP_RFD, *PMP_RFD;
/* Enum for Flow Control */
u32 tx_deferred;
/* Rx Statistics. */
- u32 rx_ov_flow; /* Rx Over Flow */
+ u32 rx_ov_flow; /* Rx Overflow */
u32 length_err;
u32 alignment_err;
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 */
/* Configuration */
u8 PermanentAddress[ETH_ALEN];
u8 CurrentAddress[ETH_ALEN];
- bool bOverrideAddress;
- bool bEepromPresent;
+ bool has_eeprom;
u8 eepromData[2];
/* Spinlocks */
spinlock_t TCBSendQLock;
spinlock_t TCBReadyQLock;
spinlock_t SendHWLock;
- spinlock_t SendWaitLock;
spinlock_t RcvLock;
spinlock_t RcvPendLock;
/* 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;
u8 MCList[NIC_MAX_MCAST_LIST][ETH_ALEN];
- /* MAC test */
- 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 */
- u32 RegistryTxNumBuffers;
- u32 RegistryTxTimeInterval;
-
- u32 RegistryRxNumBuffers;
- u32 RegistryRxTimeInterval;
-
- /* Validation helpers */
- u8 RegistryPMWOL;
- u8 RegistryNMIDisable;
- u32 RegistryDMACache;
- u32 RegistrySCGain;
- u8 RegistryPhyLoopbk; /* Enable Phy loopback */
/* Derived from the registry: */
u8 AiForceDpx; /* duplex setting */
NETIF_STATUS_MEDIA_DISCONNECT,
NETIF_STATUS_MAX
} MediaState;
- u8 DriverNoPhyAccess;
/* Minimize init-time */
- bool bQueryPending;
- bool bSetPending;
- bool bResetPending;
struct timer_list ErrorTimer;
- bool bLinkTimerActive;
MP_POWER_MGMT PoMgmt;
- INTERRUPT_t CachedMaskValue;
+ u32 CachedMaskValue;
/* Xcvr status at last poll */
MI_BMSR_t Bmsr;
/* Tx Memory Variables */
- TX_RING_t TxRing;
+ struct tx_ring tx_ring;
/* Rx Memory Variables */
- RX_RING_t RxRing;
-
- /* ET1310 register Access */
- JAGCORE_ACCESS_REGS JagCoreRegs;
- PCI_CFG_SPACE_REGS PciCfgRegs;
+ struct rx_ring rx_ring;
/* Loopback specifics */
u8 ReplicaPhyLoopbk; /* Replica Enable */