aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-23 04:29:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-24 07:26:52 -0400
commit3473a5b11827fa0f84f18b79373a26290798f54a (patch)
tree8ca354bc60565904930a8b114528380f06c99cb9
parent19e71cf6910defed10c5d22af9f4591bbcd6a0fe (diff)
sfc: Rename Falcon-specific board code and types
Siena will require entirely different board code. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/sfc/Makefile2
-rw-r--r--drivers/net/sfc/boards.h10
-rw-r--r--drivers/net/sfc/falcon.c2
-rw-r--r--drivers/net/sfc/falcon_boards.c (renamed from drivers/net/sfc/boards.c)35
-rw-r--r--drivers/net/sfc/sfe4001.c2
5 files changed, 25 insertions, 26 deletions
diff --git a/drivers/net/sfc/Makefile b/drivers/net/sfc/Makefile
index b89f9be3cb1..eb217d34e24 100644
--- a/drivers/net/sfc/Makefile
+++ b/drivers/net/sfc/Makefile
@@ -1,6 +1,6 @@
1sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \ 1sfc-y += efx.o falcon.o tx.o rx.o falcon_gmac.o \
2 falcon_xmac.o selftest.o ethtool.o xfp_phy.o \ 2 falcon_xmac.o selftest.o ethtool.o xfp_phy.o \
3 mdio_10g.o tenxpress.o boards.o sfe4001.o 3 mdio_10g.o tenxpress.o falcon_boards.o sfe4001.o
4sfc-$(CONFIG_SFC_MTD) += mtd.o 4sfc-$(CONFIG_SFC_MTD) += mtd.o
5 5
6obj-$(CONFIG_SFC) += sfc.o 6obj-$(CONFIG_SFC) += sfc.o
diff --git a/drivers/net/sfc/boards.h b/drivers/net/sfc/boards.h
index 44942de0e08..c1a57106bd1 100644
--- a/drivers/net/sfc/boards.h
+++ b/drivers/net/sfc/boards.h
@@ -10,15 +10,9 @@
10#ifndef EFX_BOARDS_H 10#ifndef EFX_BOARDS_H
11#define EFX_BOARDS_H 11#define EFX_BOARDS_H
12 12
13/* Board IDs (must fit in 8 bits) */ 13#define FALCON_BOARD_SFE4001 0x01
14enum efx_board_type {
15 EFX_BOARD_SFE4001 = 1,
16 EFX_BOARD_SFE4002 = 2,
17 EFX_BOARD_SFN4111T = 0x51,
18 EFX_BOARD_SFN4112F = 0x52,
19};
20 14
21extern void efx_set_board_info(struct efx_nic *efx, u16 revision_info); 15extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
22 16
23/* SFE4001 (10GBASE-T) */ 17/* SFE4001 (10GBASE-T) */
24extern int sfe4001_init(struct efx_nic *efx); 18extern int sfe4001_init(struct efx_nic *efx);
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 57898fd5298..abc6b632df9 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -2732,7 +2732,7 @@ static int falcon_probe_nvconfig(struct efx_nic *efx)
2732 2732
2733 EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad); 2733 EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
2734 2734
2735 efx_set_board_info(efx, board_rev); 2735 falcon_probe_board(efx, board_rev);
2736 2736
2737 kfree(nvconfig); 2737 kfree(nvconfig);
2738 return 0; 2738 return 0;
diff --git a/drivers/net/sfc/boards.c b/drivers/net/sfc/falcon_boards.c
index 4a4c74c891b..431b74c4a96 100644
--- a/drivers/net/sfc/boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -15,9 +15,14 @@
15 15
16/* Macros for unpacking the board revision */ 16/* Macros for unpacking the board revision */
17/* The revision info is in host byte order. */ 17/* The revision info is in host byte order. */
18#define BOARD_TYPE(_rev) (_rev >> 8) 18#define FALCON_BOARD_TYPE(_rev) (_rev >> 8)
19#define BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf) 19#define FALCON_BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf)
20#define BOARD_MINOR(_rev) (_rev & 0xf) 20#define FALCON_BOARD_MINOR(_rev) (_rev & 0xf)
21
22/* Board types */
23#define FALCON_BOARD_SFE4002 0x02
24#define FALCON_BOARD_SFN4111T 0x51
25#define FALCON_BOARD_SFN4112F 0x52
21 26
22/* Blink support. If the PHY has no auto-blink mode so we hang it off a timer */ 27/* Blink support. If the PHY has no auto-blink mode so we hang it off a timer */
23#define BLINK_INTERVAL (HZ/2) 28#define BLINK_INTERVAL (HZ/2)
@@ -286,31 +291,31 @@ static int sfn4112f_init(struct efx_nic *efx)
286 291
287/* This will get expanded as board-specific details get moved out of the 292/* This will get expanded as board-specific details get moved out of the
288 * PHY drivers. */ 293 * PHY drivers. */
289struct efx_board_data { 294struct falcon_board_data {
290 enum efx_board_type type; 295 u8 type;
291 const char *ref_model; 296 const char *ref_model;
292 const char *gen_type; 297 const char *gen_type;
293 int (*init) (struct efx_nic *nic); 298 int (*init) (struct efx_nic *nic);
294}; 299};
295 300
296 301
297static struct efx_board_data board_data[] = { 302static struct falcon_board_data board_data[] = {
298 { EFX_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init }, 303 { FALCON_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init },
299 { EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init }, 304 { FALCON_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
300 { EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter", 305 { FALCON_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
301 sfn4111t_init }, 306 sfn4111t_init },
302 { EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter", 307 { FALCON_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
303 sfn4112f_init }, 308 sfn4112f_init },
304}; 309};
305 310
306void efx_set_board_info(struct efx_nic *efx, u16 revision_info) 311void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
307{ 312{
308 struct efx_board_data *data = NULL; 313 struct falcon_board_data *data = NULL;
309 int i; 314 int i;
310 315
311 efx->board_info.type = BOARD_TYPE(revision_info); 316 efx->board_info.type = FALCON_BOARD_TYPE(revision_info);
312 efx->board_info.major = BOARD_MAJOR(revision_info); 317 efx->board_info.major = FALCON_BOARD_MAJOR(revision_info);
313 efx->board_info.minor = BOARD_MINOR(revision_info); 318 efx->board_info.minor = FALCON_BOARD_MINOR(revision_info);
314 319
315 for (i = 0; i < ARRAY_SIZE(board_data); i++) 320 for (i = 0; i < ARRAY_SIZE(board_data); i++)
316 if (board_data[i].type == efx->board_info.type) 321 if (board_data[i].type == efx->board_info.type)
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c
index cee00ad49b5..28a55047cc9 100644
--- a/drivers/net/sfc/sfe4001.c
+++ b/drivers/net/sfc/sfe4001.c
@@ -241,7 +241,7 @@ static ssize_t set_phy_flash_cfg(struct device *dev,
241 efx->phy_mode = new_mode; 241 efx->phy_mode = new_mode;
242 if (new_mode & PHY_MODE_SPECIAL) 242 if (new_mode & PHY_MODE_SPECIAL)
243 efx_stats_disable(efx); 243 efx_stats_disable(efx);
244 if (efx->board_info.type == EFX_BOARD_SFE4001) 244 if (efx->board_info.type == FALCON_BOARD_SFE4001)
245 err = sfe4001_poweron(efx); 245 err = sfe4001_poweron(efx);
246 else 246 else
247 err = sfn4111t_reset(efx); 247 err = sfn4111t_reset(efx);