Commit ae3a08aa authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

staging: et131x: Kill of the eFLOW_CONTROL enum

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 072e9f60
...@@ -191,7 +191,7 @@ void ConfigMACRegs2(struct et131x_adapter *etdev) ...@@ -191,7 +191,7 @@ void ConfigMACRegs2(struct et131x_adapter *etdev)
cfg1 |= CFG1_RX_ENABLE|CFG1_TX_ENABLE|CFG1_TX_FLOW; cfg1 |= CFG1_RX_ENABLE|CFG1_TX_ENABLE|CFG1_TX_FLOW;
/* Initialize loop back to off */ /* Initialize loop back to off */
cfg1 &= ~(CFG1_LOOPBACK|CFG1_RX_FLOW); cfg1 &= ~(CFG1_LOOPBACK|CFG1_RX_FLOW);
if (etdev->FlowControl == RxOnly || etdev->FlowControl == Both) if (etdev->flowcontrol == FLOW_RXONLY || etdev->flowcontrol == FLOW_BOTH)
cfg1 |= CFG1_RX_FLOW; cfg1 |= CFG1_RX_FLOW;
writel(cfg1, &pMac->cfg1); writel(cfg1, &pMac->cfg1);
...@@ -373,7 +373,7 @@ void ConfigTxMacRegs(struct et131x_adapter *etdev) ...@@ -373,7 +373,7 @@ void ConfigTxMacRegs(struct et131x_adapter *etdev)
* cfpt - control frame pause timer set to 64 (0x40) * cfpt - control frame pause timer set to 64 (0x40)
* cfep - control frame extended pause timer set to 0x0 * cfep - control frame extended pause timer set to 0x0
*/ */
if (etdev->FlowControl == None) if (etdev->flowcontrol == FLOW_NONE)
writel(0, &txmac->cf_param); writel(0, &txmac->cf_param);
else else
writel(0x40, &txmac->cf_param); writel(0x40, &txmac->cf_param);
...@@ -414,7 +414,7 @@ void ConfigMacStatRegs(struct et131x_adapter *etdev) ...@@ -414,7 +414,7 @@ void ConfigMacStatRegs(struct et131x_adapter *etdev)
void ConfigFlowControl(struct et131x_adapter *etdev) void ConfigFlowControl(struct et131x_adapter *etdev)
{ {
if (etdev->duplex_mode == 0) { if (etdev->duplex_mode == 0) {
etdev->FlowControl = None; etdev->flowcontrol = FLOW_NONE;
} else { } else {
char remote_pause, remote_async_pause; char remote_pause, remote_async_pause;
...@@ -426,22 +426,22 @@ void ConfigFlowControl(struct et131x_adapter *etdev) ...@@ -426,22 +426,22 @@ void ConfigFlowControl(struct et131x_adapter *etdev)
if ((remote_pause == TRUEPHY_BIT_SET) && if ((remote_pause == TRUEPHY_BIT_SET) &&
(remote_async_pause == TRUEPHY_BIT_SET)) { (remote_async_pause == TRUEPHY_BIT_SET)) {
etdev->FlowControl = etdev->RegistryFlowControl; etdev->flowcontrol = etdev->wanted_flow;
} else if ((remote_pause == TRUEPHY_BIT_SET) && } else if ((remote_pause == TRUEPHY_BIT_SET) &&
(remote_async_pause == TRUEPHY_BIT_CLEAR)) { (remote_async_pause == TRUEPHY_BIT_CLEAR)) {
if (etdev->RegistryFlowControl == Both) if (etdev->wanted_flow == FLOW_BOTH)
etdev->FlowControl = Both; etdev->flowcontrol = FLOW_BOTH;
else else
etdev->FlowControl = None; etdev->flowcontrol = FLOW_NONE;
} else if ((remote_pause == TRUEPHY_BIT_CLEAR) && } else if ((remote_pause == TRUEPHY_BIT_CLEAR) &&
(remote_async_pause == TRUEPHY_BIT_CLEAR)) { (remote_async_pause == TRUEPHY_BIT_CLEAR)) {
etdev->FlowControl = None; etdev->flowcontrol = FLOW_NONE;
} else {/* if (remote_pause == TRUEPHY_CLEAR_BIT && } else {/* if (remote_pause == TRUEPHY_CLEAR_BIT &&
remote_async_pause == TRUEPHY_SET_BIT) */ remote_async_pause == TRUEPHY_SET_BIT) */
if (etdev->RegistryFlowControl == Both) if (etdev->wanted_flow == FLOW_BOTH)
etdev->FlowControl = RxOnly; etdev->flowcontrol = FLOW_RXONLY;
else else
etdev->FlowControl = None; etdev->flowcontrol = FLOW_NONE;
} }
} }
} }
......
...@@ -618,15 +618,15 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev) ...@@ -618,15 +618,15 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
/* Determine if we need to go into a force mode and set it */ /* Determine if we need to go into a force mode and set it */
if (etdev->AiForceSpeed == 0 && etdev->AiForceDpx == 0) { if (etdev->AiForceSpeed == 0 && etdev->AiForceDpx == 0) {
if (etdev->RegistryFlowControl == TxOnly || if (etdev->wanted_flow == FLOW_TXONLY ||
etdev->RegistryFlowControl == Both) etdev->wanted_flow == FLOW_BOTH)
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 11, NULL); TRUEPHY_BIT_SET, 4, 11, NULL);
else else
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_CLEAR, 4, 11, NULL); TRUEPHY_BIT_CLEAR, 4, 11, NULL);
if (etdev->RegistryFlowControl == Both) if (etdev->wanted_flow == FLOW_BOTH)
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 10, NULL); TRUEPHY_BIT_SET, 4, 10, NULL);
else else
...@@ -645,15 +645,15 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev) ...@@ -645,15 +645,15 @@ static void et131x_xcvr_init(struct et131x_adapter *etdev)
/* Set to the correct force mode. */ /* Set to the correct force mode. */
if (etdev->AiForceDpx != 1) { if (etdev->AiForceDpx != 1) {
if (etdev->RegistryFlowControl == TxOnly || if (etdev->wanted_flow == FLOW_TXONLY ||
etdev->RegistryFlowControl == Both) etdev->wanted_flow == FLOW_BOTH)
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 11, NULL); TRUEPHY_BIT_SET, 4, 11, NULL);
else else
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_CLEAR, 4, 11, NULL); TRUEPHY_BIT_CLEAR, 4, 11, NULL);
if (etdev->RegistryFlowControl == Both) if (etdev->wanted_flow == FLOW_BOTH)
ET1310_PhyAccessMiBit(etdev, ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 10, NULL); TRUEPHY_BIT_SET, 4, 10, NULL);
else else
......
...@@ -547,7 +547,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb) ...@@ -547,7 +547,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb)
tcb->index_start = etdev->tx_ring.send_idx; tcb->index_start = etdev->tx_ring.send_idx;
tcb->stale = 0; tcb->stale = 0;
spin_lock_irqsave(&etdev->SendHWLock, flags); spin_lock_irqsave(&etdev->send_hw_lock, flags);
thiscopy = NUM_DESC_PER_RING_TX - thiscopy = NUM_DESC_PER_RING_TX -
INDEX10(etdev->tx_ring.send_idx); INDEX10(etdev->tx_ring.send_idx);
...@@ -613,7 +613,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb) ...@@ -613,7 +613,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb)
writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO,
&etdev->regs->global.watchdog_timer); &etdev->regs->global.watchdog_timer);
} }
spin_unlock_irqrestore(&etdev->SendHWLock, flags); spin_unlock_irqrestore(&etdev->send_hw_lock, flags);
return 0; return 0;
} }
......
...@@ -91,13 +91,11 @@ typedef struct _MP_RFD { ...@@ -91,13 +91,11 @@ typedef struct _MP_RFD {
u8 ringindex; u8 ringindex;
} MP_RFD, *PMP_RFD; } MP_RFD, *PMP_RFD;
/* Enum for Flow Control */ /* Flow Control */
typedef enum _eflow_control_t { #define FLOW_BOTH 0
Both = 0, #define FLOW_TXONLY 1
TxOnly = 1, #define FLOW_RXONLY 2
RxOnly = 2, #define FLOW_NONE 3
None = 3
} eFLOW_CONTROL_t, *PeFLOW_CONTROL_t;
/* Struct to define some device statistics */ /* Struct to define some device statistics */
typedef struct _ce_stats_t { typedef struct _ce_stats_t {
...@@ -185,7 +183,7 @@ struct et131x_adapter { ...@@ -185,7 +183,7 @@ struct et131x_adapter {
spinlock_t TCBReadyQLock; spinlock_t TCBReadyQLock;
spinlock_t send_hw_lock; spinlock_t send_hw_lock;
spinlock_t RcvLock; spinlock_t rcv_lock;
spinlock_t RcvPendLock; spinlock_t RcvPendLock;
spinlock_t FbrLock; spinlock_t FbrLock;
...@@ -205,7 +203,7 @@ struct et131x_adapter { ...@@ -205,7 +203,7 @@ struct et131x_adapter {
/* Registry parameters */ /* Registry parameters */
u8 SpeedDuplex; /* speed/duplex */ u8 SpeedDuplex; /* speed/duplex */
eFLOW_CONTROL_t RegistryFlowControl; /* for 802.3x flow control */ u8 wanted_flow; /* Flow we want for 802.3x flow control */
u8 RegistryPhyComa; /* Phy Coma mode enable/disable */ u8 RegistryPhyComa; /* Phy Coma mode enable/disable */
u32 RegistryRxMemEnd; /* Size of internal rx memory */ u32 RegistryRxMemEnd; /* Size of internal rx memory */
...@@ -214,8 +212,8 @@ struct et131x_adapter { ...@@ -214,8 +212,8 @@ struct et131x_adapter {
/* Derived from the registry: */ /* Derived from the registry: */
u8 AiForceDpx; /* duplex setting */ u8 AiForceDpx; /* duplex setting */
u16 AiForceSpeed; /* 'Speed', user over-ride of line speed */ u16 AiForceSpeed; /* 'Speed', user over-ride of line speed */
eFLOW_CONTROL_t FlowControl; /* flow control validated by the far-end */ u8 flowcontrol; /* flow control validated by the far-end */
enum { enum {
NETIF_STATUS_INVALID = 0, NETIF_STATUS_INVALID = 0,
NETIF_STATUS_MEDIA_CONNECT, NETIF_STATUS_MEDIA_CONNECT,
......
...@@ -119,7 +119,7 @@ void et131x_enable_interrupts(struct et131x_adapter *adapter) ...@@ -119,7 +119,7 @@ void et131x_enable_interrupts(struct et131x_adapter *adapter)
u32 mask; u32 mask;
/* Enable all global interrupts */ /* Enable all global interrupts */
if (adapter->FlowControl == TxOnly || adapter->FlowControl == Both) if (adapter->flowcontrol == FLOW_TXONLY || adapter->flowcontrol == FLOW_BOTH)
mask = INT_MASK_ENABLE; mask = INT_MASK_ENABLE;
else else
mask = INT_MASK_ENABLE_NO_FLOW; mask = INT_MASK_ENABLE_NO_FLOW;
...@@ -177,8 +177,8 @@ irqreturn_t et131x_isr(int irq, void *dev_id) ...@@ -177,8 +177,8 @@ irqreturn_t et131x_isr(int irq, void *dev_id)
*/ */
status = readl(&adapter->regs->global.int_status); status = readl(&adapter->regs->global.int_status);
if (adapter->FlowControl == TxOnly || if (adapter->flowcontrol == FLOW_TXONLY ||
adapter->FlowControl == Both) { adapter->flowcontrol == FLOW_BOTH) {
status &= ~INT_MASK_ENABLE; status &= ~INT_MASK_ENABLE;
} else { } else {
status &= ~INT_MASK_ENABLE_NO_FLOW; status &= ~INT_MASK_ENABLE_NO_FLOW;
...@@ -295,8 +295,8 @@ void et131x_isr_handler(struct work_struct *work) ...@@ -295,8 +295,8 @@ void et131x_isr_handler(struct work_struct *work)
/* If the user has flow control on, then we will /* If the user has flow control on, then we will
* send a pause packet, otherwise just exit * send a pause packet, otherwise just exit
*/ */
if (etdev->FlowControl == TxOnly || if (etdev->flowcontrol == FLOW_TXONLY ||
etdev->FlowControl == Both) { etdev->flowcontrol == FLOW_BOTH) {
u32 pm_csr; u32 pm_csr;
/* Tell the device to send a pause packet via /* Tell the device to send a pause packet via
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment