aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/falcon_gmac.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-11-23 11:06:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-24 13:58:53 -0500
commiteb50c0d67fe3c5513c717c2dee6d9771c51be703 (patch)
tree449f56f6c8fac242be9ac57663ad98128524b404 /drivers/net/sfc/falcon_gmac.c
parente775fb93a880d218ce0b3fd405278dd78f86c405 (diff)
sfc: Gather link state fields in struct efx_nic into new struct efx_link_state
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon_gmac.c')
-rw-r--r--drivers/net/sfc/falcon_gmac.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/sfc/falcon_gmac.c b/drivers/net/sfc/falcon_gmac.c
index 8a1b80d1ff28..967f3fb397c9 100644
--- a/drivers/net/sfc/falcon_gmac.c
+++ b/drivers/net/sfc/falcon_gmac.c
@@ -24,16 +24,17 @@
24 24
25static void falcon_reconfigure_gmac(struct efx_nic *efx) 25static void falcon_reconfigure_gmac(struct efx_nic *efx)
26{ 26{
27 struct efx_link_state *link_state = &efx->link_state;
27 bool loopback, tx_fc, rx_fc, bytemode; 28 bool loopback, tx_fc, rx_fc, bytemode;
28 int if_mode; 29 int if_mode;
29 unsigned int max_frame_len; 30 unsigned int max_frame_len;
30 efx_oword_t reg; 31 efx_oword_t reg;
31 32
32 /* Configuration register 1 */ 33 /* Configuration register 1 */
33 tx_fc = (efx->link_fc & EFX_FC_TX) || !efx->link_fd; 34 tx_fc = (link_state->fc & EFX_FC_TX) || !link_state->fd;
34 rx_fc = !!(efx->link_fc & EFX_FC_RX); 35 rx_fc = !!(link_state->fc & EFX_FC_RX);
35 loopback = (efx->loopback_mode == LOOPBACK_GMAC); 36 loopback = (efx->loopback_mode == LOOPBACK_GMAC);
36 bytemode = (efx->link_speed == 1000); 37 bytemode = (link_state->speed == 1000);
37 38
38 EFX_POPULATE_OWORD_5(reg, 39 EFX_POPULATE_OWORD_5(reg,
39 FRF_AB_GM_LOOP, loopback, 40 FRF_AB_GM_LOOP, loopback,
@@ -50,7 +51,7 @@ static void falcon_reconfigure_gmac(struct efx_nic *efx)
50 FRF_AB_GM_IF_MODE, if_mode, 51 FRF_AB_GM_IF_MODE, if_mode,
51 FRF_AB_GM_PAD_CRC_EN, 1, 52 FRF_AB_GM_PAD_CRC_EN, 1,
52 FRF_AB_GM_LEN_CHK, 1, 53 FRF_AB_GM_LEN_CHK, 1,
53 FRF_AB_GM_FD, efx->link_fd, 54 FRF_AB_GM_FD, link_state->fd,
54 FRF_AB_GM_PAMBL_LEN, 0x7/*datasheet recommended */); 55 FRF_AB_GM_PAMBL_LEN, 0x7/*datasheet recommended */);
55 56
56 efx_writeo(efx, &reg, FR_AB_GM_CFG2); 57 efx_writeo(efx, &reg, FR_AB_GM_CFG2);
@@ -101,8 +102,8 @@ static void falcon_reconfigure_gmac(struct efx_nic *efx)
101 /* FIFO configuration register 5 */ 102 /* FIFO configuration register 5 */
102 efx_reado(efx, &reg, FR_AB_GMF_CFG5); 103 efx_reado(efx, &reg, FR_AB_GMF_CFG5);
103 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_CFGBYTMODE, bytemode); 104 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_CFGBYTMODE, bytemode);
104 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_CFGHDPLX, !efx->link_fd); 105 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_CFGHDPLX, !link_state->fd);
105 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_HSTDRPLT64, !efx->link_fd); 106 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_HSTDRPLT64, !link_state->fd);
106 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_HSTFLTRFRMDC_PAUSE, 0); 107 EFX_SET_OWORD_FIELD(reg, FRF_AB_GMF_HSTFLTRFRMDC_PAUSE, 0);
107 efx_writeo(efx, &reg, FR_AB_GMF_CFG5); 108 efx_writeo(efx, &reg, FR_AB_GMF_CFG5);
108 udelay(10); 109 udelay(10);