Commit 26ca0f1b authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman

staging: et131x: Reduce split lines by renaming flowcontrol

Rename adapter->flowcontrol to adapter->flow, reducing split lines.
Signed-off-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c9e3c03a
...@@ -488,7 +488,7 @@ struct et131x_adapter { ...@@ -488,7 +488,7 @@ struct et131x_adapter {
u32 registry_jumbo_packet; /* Max supported ethernet packet size */ u32 registry_jumbo_packet; /* Max supported ethernet packet size */
/* Derived from the registry: */ /* Derived from the registry: */
u8 flowcontrol; /* flow control validated by the far-end */ u8 flow; /* flow control validated by the far-end */
/* Minimize init-time */ /* Minimize init-time */
struct timer_list error_timer; struct timer_list error_timer;
...@@ -949,8 +949,7 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter) ...@@ -949,8 +949,7 @@ static void et1310_config_mac_regs2(struct et131x_adapter *adapter)
ET_MAC_CFG1_TX_FLOW; ET_MAC_CFG1_TX_FLOW;
/* Initialize loop back to off */ /* Initialize loop back to off */
cfg1 &= ~(ET_MAC_CFG1_LOOPBACK | ET_MAC_CFG1_RX_FLOW); cfg1 &= ~(ET_MAC_CFG1_LOOPBACK | ET_MAC_CFG1_RX_FLOW);
if (adapter->flowcontrol == FLOW_RXONLY || if (adapter->flow == FLOW_RXONLY || adapter->flow == FLOW_BOTH)
adapter->flowcontrol == FLOW_BOTH)
cfg1 |= ET_MAC_CFG1_RX_FLOW; cfg1 |= ET_MAC_CFG1_RX_FLOW;
writel(cfg1, &mac->cfg1); writel(cfg1, &mac->cfg1);
...@@ -1219,7 +1218,7 @@ static void et1310_config_txmac_regs(struct et131x_adapter *adapter) ...@@ -1219,7 +1218,7 @@ static void et1310_config_txmac_regs(struct et131x_adapter *adapter)
* 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 (adapter->flowcontrol == FLOW_NONE) if (adapter->flow == FLOW_NONE)
writel(0, &txmac->cf_param); writel(0, &txmac->cf_param);
else else
writel(0x40, &txmac->cf_param); writel(0x40, &txmac->cf_param);
...@@ -1400,7 +1399,7 @@ static void et1310_config_flow_control(struct et131x_adapter *adapter) ...@@ -1400,7 +1399,7 @@ static void et1310_config_flow_control(struct et131x_adapter *adapter)
struct phy_device *phydev = adapter->phydev; struct phy_device *phydev = adapter->phydev;
if (phydev->duplex == DUPLEX_HALF) { if (phydev->duplex == DUPLEX_HALF) {
adapter->flowcontrol = FLOW_NONE; adapter->flow = FLOW_NONE;
} else { } else {
char remote_pause, remote_async_pause; char remote_pause, remote_async_pause;
...@@ -1408,19 +1407,19 @@ static void et1310_config_flow_control(struct et131x_adapter *adapter) ...@@ -1408,19 +1407,19 @@ static void et1310_config_flow_control(struct et131x_adapter *adapter)
et1310_phy_read_mii_bit(adapter, 5, 11, &remote_async_pause); et1310_phy_read_mii_bit(adapter, 5, 11, &remote_async_pause);
if (remote_pause && remote_async_pause) { if (remote_pause && remote_async_pause) {
adapter->flowcontrol = adapter->wanted_flow; adapter->flow = adapter->wanted_flow;
} else if (remote_pause && !remote_async_pause) { } else if (remote_pause && !remote_async_pause) {
if (adapter->wanted_flow == FLOW_BOTH) if (adapter->wanted_flow == FLOW_BOTH)
adapter->flowcontrol = FLOW_BOTH; adapter->flow = FLOW_BOTH;
else else
adapter->flowcontrol = FLOW_NONE; adapter->flow = FLOW_NONE;
} else if (!remote_pause && !remote_async_pause) { } else if (!remote_pause && !remote_async_pause) {
adapter->flowcontrol = FLOW_NONE; adapter->flow = FLOW_NONE;
} else { } else {
if (adapter->wanted_flow == FLOW_BOTH) if (adapter->wanted_flow == FLOW_BOTH)
adapter->flowcontrol = FLOW_RXONLY; adapter->flow = FLOW_RXONLY;
else else
adapter->flowcontrol = FLOW_NONE; adapter->flow = FLOW_NONE;
} }
} }
} }
...@@ -1807,8 +1806,7 @@ static void et131x_enable_interrupts(struct et131x_adapter *adapter) ...@@ -1807,8 +1806,7 @@ static void et131x_enable_interrupts(struct et131x_adapter *adapter)
u32 mask; u32 mask;
/* Enable all global interrupts */ /* Enable all global interrupts */
if (adapter->flowcontrol == FLOW_TXONLY || if (adapter->flow == FLOW_TXONLY || adapter->flow == FLOW_BOTH)
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;
...@@ -3651,12 +3649,10 @@ static irqreturn_t et131x_isr(int irq, void *dev_id) ...@@ -3651,12 +3649,10 @@ static 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 == FLOW_TXONLY || if (adapter->flow == FLOW_TXONLY || adapter->flow == FLOW_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;
}
/* Make sure this is our interrupt */ /* Make sure this is our interrupt */
if (!status) { if (!status) {
...@@ -3718,8 +3714,7 @@ static irqreturn_t et131x_isr(int irq, void *dev_id) ...@@ -3718,8 +3714,7 @@ static irqreturn_t et131x_isr(int irq, void *dev_id)
/* 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 (adapter->flowcontrol == FLOW_TXONLY || if (adapter->flow == FLOW_TXONLY || adapter->flow == FLOW_BOTH) {
adapter->flowcontrol == FLOW_BOTH) {
u32 pm_csr; u32 pm_csr;
/* Tell the device to send a pause packet via the back /* Tell the device to send a pause packet via the back
......
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