aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc
diff options
context:
space:
mode:
authorSteve Hodgson <shodgson@solarflare.com>2009-11-28 00:35:00 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-29 02:58:51 -0500
commitb895d73e9836fccc402e48a8f63e6805d2edc87b (patch)
treebe2adb58b8756e6f27666cf7bc4f24dbb0b23d23 /drivers/net/sfc
parentab86746175a5e1379abb9c7c38522af4d3176f57 (diff)
sfc: Always start Falcon using the XMAC
The strap bits are only important on Falcon A and all production boards using it have fixed-speed 10G PHYs. Replace dummy MAC operations with default MAC operations. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r--drivers/net/sfc/efx.c6
-rw-r--r--drivers/net/sfc/falcon.c15
-rw-r--r--drivers/net/sfc/net_driver.h3
3 files changed, 16 insertions, 8 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 6338ad8dbfbb..bed45a599874 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1891,10 +1891,6 @@ bool efx_port_dummy_op_poll(struct efx_nic *efx)
1891 return false; 1891 return false;
1892} 1892}
1893 1893
1894static struct efx_mac_operations efx_dummy_mac_operations = {
1895 .reconfigure = efx_port_dummy_op_void,
1896};
1897
1898static struct efx_phy_operations efx_dummy_phy_operations = { 1894static struct efx_phy_operations efx_dummy_phy_operations = {
1899 .init = efx_port_dummy_op_int, 1895 .init = efx_port_dummy_op_int,
1900 .reconfigure = efx_port_dummy_op_void, 1896 .reconfigure = efx_port_dummy_op_void,
@@ -1936,7 +1932,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
1936 spin_lock_init(&efx->netif_stop_lock); 1932 spin_lock_init(&efx->netif_stop_lock);
1937 spin_lock_init(&efx->stats_lock); 1933 spin_lock_init(&efx->stats_lock);
1938 mutex_init(&efx->mac_lock); 1934 mutex_init(&efx->mac_lock);
1939 efx->mac_op = &efx_dummy_mac_operations; 1935 efx->mac_op = type->default_mac_ops;
1940 efx->phy_op = &efx_dummy_phy_operations; 1936 efx->phy_op = &efx_dummy_phy_operations;
1941 efx->mdio.dev = net_dev; 1937 efx->mdio.dev = net_dev;
1942 INIT_WORK(&efx->mac_work, efx_mac_work); 1938 INIT_WORK(&efx->mac_work, efx_mac_work);
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 372dbbc72404..9c4f8985aa71 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2291,6 +2291,10 @@ int falcon_probe_port(struct efx_nic *efx)
2291 efx->mdio.mdio_read = falcon_mdio_read; 2291 efx->mdio.mdio_read = falcon_mdio_read;
2292 efx->mdio.mdio_write = falcon_mdio_write; 2292 efx->mdio.mdio_write = falcon_mdio_write;
2293 2293
2294 /* Initial assumption */
2295 efx->link_state.speed = 10000;
2296 efx->link_state.fd = true;
2297
2294 /* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */ 2298 /* Hardware flow ctrl. FalconA RX FIFO too small for pause generation */
2295 if (falcon_rev(efx) >= FALCON_REV_B0) 2299 if (falcon_rev(efx) >= FALCON_REV_B0)
2296 efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; 2300 efx->wanted_fc = EFX_FC_RX | EFX_FC_TX;
@@ -2809,6 +2813,10 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
2809 return -ENODEV; 2813 return -ENODEV;
2810 2814
2811 case FALCON_REV_A1: 2815 case FALCON_REV_A1:
2816 if (EFX_OWORD_FIELD(nic_stat, FRF_AB_STRAP_10G) == 0) {
2817 EFX_ERR(efx, "Falcon rev A1 1G not supported\n");
2818 return -ENODEV;
2819 }
2812 if (EFX_OWORD_FIELD(nic_stat, FRF_AA_STRAP_PCIE) == 0) { 2820 if (EFX_OWORD_FIELD(nic_stat, FRF_AA_STRAP_PCIE) == 0) {
2813 EFX_ERR(efx, "Falcon rev A1 PCI-X not supported\n"); 2821 EFX_ERR(efx, "Falcon rev A1 PCI-X not supported\n");
2814 return -ENODEV; 2822 return -ENODEV;
@@ -2823,9 +2831,6 @@ static int falcon_probe_nic_variant(struct efx_nic *efx)
2823 return -ENODEV; 2831 return -ENODEV;
2824 } 2832 }
2825 2833
2826 /* Initial assumed speed */
2827 efx->link_state.speed = EFX_OWORD_FIELD(nic_stat, FRF_AB_STRAP_10G) ? 10000 : 1000;
2828
2829 return 0; 2834 return 0;
2830} 2835}
2831 2836
@@ -3238,6 +3243,8 @@ void falcon_stop_nic_stats(struct efx_nic *efx)
3238 */ 3243 */
3239 3244
3240struct efx_nic_type falcon_a_nic_type = { 3245struct efx_nic_type falcon_a_nic_type = {
3246 .default_mac_ops = &falcon_xmac_operations,
3247
3241 .mem_map_size = 0x20000, 3248 .mem_map_size = 0x20000,
3242 .txd_ptr_tbl_base = FR_AA_TX_DESC_PTR_TBL_KER, 3249 .txd_ptr_tbl_base = FR_AA_TX_DESC_PTR_TBL_KER,
3243 .rxd_ptr_tbl_base = FR_AA_RX_DESC_PTR_TBL_KER, 3250 .rxd_ptr_tbl_base = FR_AA_RX_DESC_PTR_TBL_KER,
@@ -3251,6 +3258,8 @@ struct efx_nic_type falcon_a_nic_type = {
3251}; 3258};
3252 3259
3253struct efx_nic_type falcon_b_nic_type = { 3260struct efx_nic_type falcon_b_nic_type = {
3261 .default_mac_ops = &falcon_xmac_operations,
3262
3254 /* Map everything up to and including the RSS indirection 3263 /* Map everything up to and including the RSS indirection
3255 * table. Don't map MSI-X table, MSI-X PBA since Linux 3264 * table. Don't map MSI-X table, MSI-X PBA since Linux
3256 * requires that they not be mapped. */ 3265 * requires that they not be mapped. */
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 0aeaeda9db7c..57f861468c1e 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -843,6 +843,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx)
843 843
844/** 844/**
845 * struct efx_nic_type - Efx device type definition 845 * struct efx_nic_type - Efx device type definition
846 * @default_mac_ops: efx_mac_operations to set at startup
846 * @mem_map_size: Memory BAR mapped size 847 * @mem_map_size: Memory BAR mapped size
847 * @txd_ptr_tbl_base: TX descriptor ring base address 848 * @txd_ptr_tbl_base: TX descriptor ring base address
848 * @rxd_ptr_tbl_base: RX descriptor ring base address 849 * @rxd_ptr_tbl_base: RX descriptor ring base address
@@ -857,6 +858,8 @@ static inline const char *efx_dev_name(struct efx_nic *efx)
857 * descriptors 858 * descriptors
858 */ 859 */
859struct efx_nic_type { 860struct efx_nic_type {
861 struct efx_mac_operations *default_mac_ops;
862
860 unsigned int mem_map_size; 863 unsigned int mem_map_size;
861 unsigned int txd_ptr_tbl_base; 864 unsigned int txd_ptr_tbl_base;
862 unsigned int rxd_ptr_tbl_base; 865 unsigned int rxd_ptr_tbl_base;