aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sfc/efx.c11
-rw-r--r--drivers/net/sfc/falcon.h30
-rw-r--r--drivers/net/sfc/falcon_boards.c9
-rw-r--r--drivers/net/sfc/net_driver.h27
4 files changed, 39 insertions, 38 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index c9f80042669f..b91321126fe1 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -1878,7 +1878,7 @@ static struct pci_device_id efx_pci_table[] __devinitdata = {
1878 1878
1879/************************************************************************** 1879/**************************************************************************
1880 * 1880 *
1881 * Dummy PHY/MAC/Board operations 1881 * Dummy PHY/MAC operations
1882 * 1882 *
1883 * Can be used for some unimplemented operations 1883 * Can be used for some unimplemented operations
1884 * Needed so all function pointers are valid and do not have to be tested 1884 * Needed so all function pointers are valid and do not have to be tested
@@ -1908,14 +1908,6 @@ static struct efx_phy_operations efx_dummy_phy_operations = {
1908 .clear_interrupt = efx_port_dummy_op_void, 1908 .clear_interrupt = efx_port_dummy_op_void,
1909}; 1909};
1910 1910
1911static struct falcon_board efx_dummy_board_info = {
1912 .init = efx_port_dummy_op_int,
1913 .init_phy = efx_port_dummy_op_void,
1914 .set_id_led = efx_port_dummy_op_set_id_led,
1915 .monitor = efx_port_dummy_op_int,
1916 .fini = efx_port_dummy_op_void,
1917};
1918
1919/************************************************************************** 1911/**************************************************************************
1920 * 1912 *
1921 * Data housekeeping 1913 * Data housekeeping
@@ -1944,7 +1936,6 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type,
1944 efx->state = STATE_INIT; 1936 efx->state = STATE_INIT;
1945 efx->reset_pending = RESET_TYPE_NONE; 1937 efx->reset_pending = RESET_TYPE_NONE;
1946 strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name)); 1938 strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name));
1947 efx->board_info = efx_dummy_board_info;
1948 1939
1949 efx->net_dev = net_dev; 1940 efx->net_dev = net_dev;
1950 efx->rx_checksum_enabled = true; 1941 efx->rx_checksum_enabled = true;
diff --git a/drivers/net/sfc/falcon.h b/drivers/net/sfc/falcon.h
index 46dd43bbbfd9..3e9696c12caa 100644
--- a/drivers/net/sfc/falcon.h
+++ b/drivers/net/sfc/falcon.h
@@ -31,18 +31,46 @@ static inline int falcon_rev(struct efx_nic *efx)
31} 31}
32 32
33/** 33/**
34 * struct falcon_board - board information
35 * @type: Board model type
36 * @major: Major rev. ('A', 'B' ...)
37 * @minor: Minor rev. (0, 1, ...)
38 * @init: Allocate resources and initialise peripheral hardware
39 * @init_phy: Do board-specific PHY initialisation
40 * @set_id_led: Set state of identifying LED or revert to automatic function
41 * @monitor: Board-specific health check function
42 * @fini: Shut down hardware and free resources
43 * @hwmon_client: I2C client for hardware monitor
44 * @ioexp_client: I2C client for power/port control
45 */
46struct falcon_board {
47 int type;
48 int major;
49 int minor;
50 int (*init) (struct efx_nic *nic);
51 void (*init_phy) (struct efx_nic *efx);
52 void (*set_id_led) (struct efx_nic *efx, enum efx_led_mode mode);
53 int (*monitor) (struct efx_nic *nic);
54 void (*fini) (struct efx_nic *nic);
55 struct i2c_client *hwmon_client, *ioexp_client;
56};
57
58/**
34 * struct falcon_nic_data - Falcon NIC state 59 * struct falcon_nic_data - Falcon NIC state
35 * @pci_dev2: The secondary PCI device if present 60 * @pci_dev2: The secondary PCI device if present
36 * @i2c_data: Operations and state for I2C bit-bashing algorithm 61 * @i2c_data: Operations and state for I2C bit-bashing algorithm
62 * @board: Board state and functions
37 */ 63 */
38struct falcon_nic_data { 64struct falcon_nic_data {
39 struct pci_dev *pci_dev2; 65 struct pci_dev *pci_dev2;
40 struct i2c_algo_bit_data i2c_data; 66 struct i2c_algo_bit_data i2c_data;
67 struct falcon_board board;
41}; 68};
42 69
43static inline struct falcon_board *falcon_board(struct efx_nic *efx) 70static inline struct falcon_board *falcon_board(struct efx_nic *efx)
44{ 71{
45 return &efx->board_info; 72 struct falcon_nic_data *data = efx->nic_data;
73 return &data->board;
46} 74}
47 75
48extern struct efx_nic_type falcon_a_nic_type; 76extern struct efx_nic_type falcon_a_nic_type;
diff --git a/drivers/net/sfc/falcon_boards.c b/drivers/net/sfc/falcon_boards.c
index af7cd2a0b449..20aebe07fdf2 100644
--- a/drivers/net/sfc/falcon_boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -721,12 +721,21 @@ static struct falcon_board_data board_data[] = {
721 sfn4112f_init }, 721 sfn4112f_init },
722}; 722};
723 723
724static struct falcon_board falcon_dummy_board = {
725 .init = efx_port_dummy_op_int,
726 .init_phy = efx_port_dummy_op_void,
727 .set_id_led = efx_port_dummy_op_set_id_led,
728 .monitor = efx_port_dummy_op_int,
729 .fini = efx_port_dummy_op_void,
730};
731
724void falcon_probe_board(struct efx_nic *efx, u16 revision_info) 732void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
725{ 733{
726 struct falcon_board *board = falcon_board(efx); 734 struct falcon_board *board = falcon_board(efx);
727 struct falcon_board_data *data = NULL; 735 struct falcon_board_data *data = NULL;
728 int i; 736 int i;
729 737
738 *board = falcon_dummy_board;
730 board->type = FALCON_BOARD_TYPE(revision_info); 739 board->type = FALCON_BOARD_TYPE(revision_info);
731 board->major = FALCON_BOARD_MAJOR(revision_info); 740 board->major = FALCON_BOARD_MAJOR(revision_info);
732 board->minor = FALCON_BOARD_MINOR(revision_info); 741 board->minor = FALCON_BOARD_MINOR(revision_info);
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 9b84c3ae5ed0..fdc9e157e513 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -394,31 +394,6 @@ enum efx_led_mode {
394 EFX_LED_DEFAULT = 2 394 EFX_LED_DEFAULT = 2
395}; 395};
396 396
397/**
398 * struct falcon_board - board information
399 * @type: Board model type
400 * @major: Major rev. ('A', 'B' ...)
401 * @minor: Minor rev. (0, 1, ...)
402 * @init: Allocate resources and initialise peripheral hardware
403 * @init_phy: Do board-specific PHY initialisation
404 * @set_id_led: Set state of identifying LED or revert to automatic function
405 * @monitor: Board-specific health check function
406 * @fini: Shut down hardware and free resources
407 * @hwmon_client: I2C client for hardware monitor
408 * @ioexp_client: I2C client for power/port control
409 */
410struct falcon_board {
411 int type;
412 int major;
413 int minor;
414 int (*init) (struct efx_nic *nic);
415 void (*init_phy) (struct efx_nic *efx);
416 void (*set_id_led) (struct efx_nic *efx, enum efx_led_mode mode);
417 int (*monitor) (struct efx_nic *nic);
418 void (*fini) (struct efx_nic *nic);
419 struct i2c_client *hwmon_client, *ioexp_client;
420};
421
422#define STRING_TABLE_LOOKUP(val, member) \ 397#define STRING_TABLE_LOOKUP(val, member) \
423 member ## _names[val] 398 member ## _names[val]
424 399
@@ -665,7 +640,6 @@ union efx_multicast_hash {
665 * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues 640 * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues
666 * @irq_rx_moderation: IRQ moderation time for RX event queues 641 * @irq_rx_moderation: IRQ moderation time for RX event queues
667 * @i2c_adap: I2C adapter 642 * @i2c_adap: I2C adapter
668 * @board_info: Board-level information
669 * @state: Device state flag. Serialised by the rtnl_lock. 643 * @state: Device state flag. Serialised by the rtnl_lock.
670 * @reset_pending: Pending reset method (normally RESET_TYPE_NONE) 644 * @reset_pending: Pending reset method (normally RESET_TYPE_NONE)
671 * @tx_queue: TX DMA queues 645 * @tx_queue: TX DMA queues
@@ -752,7 +726,6 @@ struct efx_nic {
752 unsigned int irq_rx_moderation; 726 unsigned int irq_rx_moderation;
753 727
754 struct i2c_adapter i2c_adap; 728 struct i2c_adapter i2c_adap;
755 struct falcon_board board_info;
756 729
757 enum nic_state state; 730 enum nic_state state;
758 enum reset_type reset_pending; 731 enum reset_type reset_pending;