staging: et131x: Remove private adapter->duplex_mode and use phydev->duplex instead
The phy device keeps a note of the duplex mode, so use that value instead of duplex mode. Also use the phydev defines for duplex modes, and remove the driver private ones. Signed-off-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
412f8e0c52
commit
06530d81d6
@ -205,11 +205,11 @@ void et1310_config_mac_regs2(struct et131x_adapter *adapter)
|
|||||||
cfg2 &= ~0x0021;
|
cfg2 &= ~0x0021;
|
||||||
|
|
||||||
/* Turn on duplex if needed */
|
/* Turn on duplex if needed */
|
||||||
if (adapter->duplex_mode)
|
if (phydev && phydev->duplex == DUPLEX_FULL)
|
||||||
cfg2 |= 0x01;
|
cfg2 |= 0x01;
|
||||||
|
|
||||||
ifctrl &= ~(1 << 26);
|
ifctrl &= ~(1 << 26);
|
||||||
if (!adapter->duplex_mode)
|
if (phydev && phydev->duplex == DUPLEX_HALF)
|
||||||
ifctrl |= (1<<26); /* Enable ghd */
|
ifctrl |= (1<<26); /* Enable ghd */
|
||||||
|
|
||||||
writel(ifctrl, &mac->if_ctrl);
|
writel(ifctrl, &mac->if_ctrl);
|
||||||
@ -450,7 +450,9 @@ void et1310_config_macstat_regs(struct et131x_adapter *adapter)
|
|||||||
|
|
||||||
void et1310_config_flow_control(struct et131x_adapter *adapter)
|
void et1310_config_flow_control(struct et131x_adapter *adapter)
|
||||||
{
|
{
|
||||||
if (adapter->duplex_mode == 0) {
|
struct phy_device *phydev = adapter->phydev;
|
||||||
|
|
||||||
|
if (phydev->duplex == DUPLEX_HALF) {
|
||||||
adapter->flowcontrol = FLOW_NONE;
|
adapter->flowcontrol = FLOW_NONE;
|
||||||
} else {
|
} else {
|
||||||
char remote_pause, remote_async_pause;
|
char remote_pause, remote_async_pause;
|
||||||
|
@ -477,8 +477,6 @@ void et131x_mii_check(struct et131x_adapter *adapter,
|
|||||||
|
|
||||||
netif_carrier_off(adapter->netdev);
|
netif_carrier_off(adapter->netdev);
|
||||||
|
|
||||||
adapter->duplex_mode = 0;
|
|
||||||
|
|
||||||
/* Free the packets being actively sent & stopped */
|
/* Free the packets being actively sent & stopped */
|
||||||
et131x_free_busy_send_packets(adapter);
|
et131x_free_busy_send_packets(adapter);
|
||||||
|
|
||||||
@ -516,8 +514,6 @@ void et131x_mii_check(struct et131x_adapter *adapter,
|
|||||||
&speed, &duplex, &mdi_mdix,
|
&speed, &duplex, &mdi_mdix,
|
||||||
&masterslave, &polarity);
|
&masterslave, &polarity);
|
||||||
|
|
||||||
adapter->duplex_mode = duplex;
|
|
||||||
|
|
||||||
adapter->boot_coma = 20;
|
adapter->boot_coma = 20;
|
||||||
|
|
||||||
if (phydev && phydev->speed == SPEED_10) {
|
if (phydev && phydev->speed == SPEED_10) {
|
||||||
|
@ -242,10 +242,6 @@ struct mi_regs {
|
|||||||
#define TRUEPHY_MASK 2
|
#define TRUEPHY_MASK 2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define duplex modes */
|
|
||||||
#define TRUEPHY_DUPLEX_HALF 0
|
|
||||||
#define TRUEPHY_DUPLEX_FULL 1
|
|
||||||
|
|
||||||
/* Define master/slave configuration values */
|
/* Define master/slave configuration values */
|
||||||
#define TRUEPHY_CFG_SLAVE 0
|
#define TRUEPHY_CFG_SLAVE 0
|
||||||
#define TRUEPHY_CFG_MASTER 1
|
#define TRUEPHY_CFG_MASTER 1
|
||||||
|
@ -169,7 +169,6 @@ struct et131x_adapter {
|
|||||||
|
|
||||||
/* Packet Filter and look ahead size */
|
/* Packet Filter and look ahead size */
|
||||||
u32 packet_filter;
|
u32 packet_filter;
|
||||||
u32 duplex_mode;
|
|
||||||
|
|
||||||
/* multicast list */
|
/* multicast list */
|
||||||
u32 multicast_addr_count;
|
u32 multicast_addr_count;
|
||||||
|
Loading…
Reference in New Issue
Block a user