Date:2010-04-28 11:01:50 (12 years 5 months ago)
Author:Ben Hutchings
Commit:e41c11ee0cc602bcde68916be85fb97d1a484324
Message:sfc: Change falcon_probe_board() to fail for unsupported boards

The driver needs specific PHY and board support code for each SFC4000
board; there is no point trying to continue if it is missing.
Currently unsupported boards can trigger an 'oops'.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Files: drivers/net/sfc/falcon.c (1 diff)
drivers/net/sfc/falcon_boards.c (2 diffs)
drivers/net/sfc/nic.h (1 diff)

Change Details

drivers/net/sfc/falcon.c
13201320
13211321    EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
13221322
1323    falcon_probe_board(efx, board_rev);
1323    rc = falcon_probe_board(efx, board_rev);
1324    if (rc)
1325        goto fail2;
13241326
13251327    kfree(nvconfig);
13261328    return 0;
drivers/net/sfc/falcon_boards.c
728728    },
729729};
730730
731static const struct falcon_board_type falcon_dummy_board = {
732    .init = efx_port_dummy_op_int,
733    .init_phy = efx_port_dummy_op_void,
734    .fini = efx_port_dummy_op_void,
735    .set_id_led = efx_port_dummy_op_set_id_led,
736    .monitor = efx_port_dummy_op_int,
737};
738
739void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
731int falcon_probe_board(struct efx_nic *efx, u16 revision_info)
740732{
741733    struct falcon_board *board = falcon_board(efx);
742734    u8 type_id = FALCON_BOARD_TYPE(revision_info);
...... 
754746             (efx->pci_dev->subsystem_vendor == EFX_VENDID_SFC)
755747             ? board->type->ref_model : board->type->gen_type,
756748             'A' + board->major, board->minor);
749        return 0;
757750    } else {
758751        EFX_ERR(efx, "unknown board type %d\n", type_id);
759        board->type = &falcon_dummy_board;
752        return -ENODEV;
760753    }
761754}
drivers/net/sfc/nic.h
156156 **************************************************************************
157157 */
158158
159extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
159extern int falcon_probe_board(struct efx_nic *efx, u16 revision_info);
160160
161161/* TX data path */
162162extern int efx_nic_probe_tx(struct efx_tx_queue *tx_queue);

Archive Download the corresponding diff file



interactive