All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-net-drivers@solarflare.com
Subject: [PATCH 03/27] sfc: Rename Falcon-specific board code and types
Date: Fri, 23 Oct 2009 19:29:16 +0100	[thread overview]
Message-ID: <1256322556.2785.9.camel@achroite> (raw)
In-Reply-To: <1256322441.2785.3.camel@achroite>

Siena will require entirely different board code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/Makefile                      |    2 +-
 drivers/net/sfc/boards.h                      |   10 +-----
 drivers/net/sfc/falcon.c                      |    2 +-
 drivers/net/sfc/{boards.c => falcon_boards.c} |   35 ++++++++++++++----------
 drivers/net/sfc/sfe4001.c                     |    2 +-
 5 files changed, 25 insertions(+), 26 deletions(-)
 rename drivers/net/sfc/{boards.c => falcon_boards.c} (90%)

diff --git a/drivers/net/sfc/Makefile b/drivers/net/sfc/Makefile
index b89f9be..eb217d3 100644
--- a/drivers/net/sfc/Makefile
+++ b/drivers/net/sfc/Makefile
@@ -1,6 +1,6 @@
 sfc-y			+= efx.o falcon.o tx.o rx.o falcon_gmac.o \
 			   falcon_xmac.o selftest.o ethtool.o xfp_phy.o \
-			   mdio_10g.o tenxpress.o boards.o sfe4001.o
+			   mdio_10g.o tenxpress.o falcon_boards.o sfe4001.o
 sfc-$(CONFIG_SFC_MTD)	+= mtd.o
 
 obj-$(CONFIG_SFC)	+= sfc.o
diff --git a/drivers/net/sfc/boards.h b/drivers/net/sfc/boards.h
index 44942de..c1a5710 100644
--- a/drivers/net/sfc/boards.h
+++ b/drivers/net/sfc/boards.h
@@ -10,15 +10,9 @@
 #ifndef EFX_BOARDS_H
 #define EFX_BOARDS_H
 
-/* Board IDs (must fit in 8 bits) */
-enum efx_board_type {
-	EFX_BOARD_SFE4001 = 1,
-	EFX_BOARD_SFE4002 = 2,
-	EFX_BOARD_SFN4111T = 0x51,
-	EFX_BOARD_SFN4112F = 0x52,
-};
+#define FALCON_BOARD_SFE4001 0x01
 
-extern void efx_set_board_info(struct efx_nic *efx, u16 revision_info);
+extern void falcon_probe_board(struct efx_nic *efx, u16 revision_info);
 
 /* SFE4001 (10GBASE-T) */
 extern int sfe4001_init(struct efx_nic *efx);
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 57898fd..abc6b63 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)
 
 	EFX_LOG(efx, "PHY is %d phy_id %d\n", efx->phy_type, efx->mdio.prtad);
 
-	efx_set_board_info(efx, board_rev);
+	falcon_probe_board(efx, board_rev);
 
 	kfree(nvconfig);
 	return 0;
diff --git a/drivers/net/sfc/boards.c b/drivers/net/sfc/falcon_boards.c
similarity index 90%
rename from drivers/net/sfc/boards.c
rename to drivers/net/sfc/falcon_boards.c
index 4a4c74c..431b74c 100644
--- a/drivers/net/sfc/boards.c
+++ b/drivers/net/sfc/falcon_boards.c
@@ -15,9 +15,14 @@
 
 /* Macros for unpacking the board revision */
 /* The revision info is in host byte order. */
-#define BOARD_TYPE(_rev) (_rev >> 8)
-#define BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf)
-#define BOARD_MINOR(_rev) (_rev & 0xf)
+#define FALCON_BOARD_TYPE(_rev) (_rev >> 8)
+#define FALCON_BOARD_MAJOR(_rev) ((_rev >> 4) & 0xf)
+#define FALCON_BOARD_MINOR(_rev) (_rev & 0xf)
+
+/* Board types */
+#define FALCON_BOARD_SFE4002 0x02
+#define FALCON_BOARD_SFN4111T 0x51
+#define FALCON_BOARD_SFN4112F 0x52
 
 /* Blink support. If the PHY has no auto-blink mode so we hang it off a timer */
 #define BLINK_INTERVAL (HZ/2)
@@ -286,31 +291,31 @@ static int sfn4112f_init(struct efx_nic *efx)
 
 /* This will get expanded as board-specific details get moved out of the
  * PHY drivers. */
-struct efx_board_data {
-	enum efx_board_type type;
+struct falcon_board_data {
+	u8 type;
 	const char *ref_model;
 	const char *gen_type;
 	int (*init) (struct efx_nic *nic);
 };
 

-static struct efx_board_data board_data[] = {
-	{ EFX_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init },
-	{ EFX_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
-	{ EFX_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
+static struct falcon_board_data board_data[] = {
+	{ FALCON_BOARD_SFE4001, "SFE4001", "10GBASE-T adapter", sfe4001_init },
+	{ FALCON_BOARD_SFE4002, "SFE4002", "XFP adapter", sfe4002_init },
+	{ FALCON_BOARD_SFN4111T, "SFN4111T", "100/1000/10GBASE-T adapter",
 	  sfn4111t_init },
-	{ EFX_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
+	{ FALCON_BOARD_SFN4112F, "SFN4112F", "SFP+ adapter",
 	  sfn4112f_init },
 };
 
-void efx_set_board_info(struct efx_nic *efx, u16 revision_info)
+void falcon_probe_board(struct efx_nic *efx, u16 revision_info)
 {
-	struct efx_board_data *data = NULL;
+	struct falcon_board_data *data = NULL;
 	int i;
 
-	efx->board_info.type = BOARD_TYPE(revision_info);
-	efx->board_info.major = BOARD_MAJOR(revision_info);
-	efx->board_info.minor = BOARD_MINOR(revision_info);
+	efx->board_info.type = FALCON_BOARD_TYPE(revision_info);
+	efx->board_info.major = FALCON_BOARD_MAJOR(revision_info);
+	efx->board_info.minor = FALCON_BOARD_MINOR(revision_info);
 
 	for (i = 0; i < ARRAY_SIZE(board_data); i++)
 		if (board_data[i].type == efx->board_info.type)
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c
index cee00ad..28a5504 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,
 		efx->phy_mode = new_mode;
 		if (new_mode & PHY_MODE_SPECIAL)
 			efx_stats_disable(efx);
-		if (efx->board_info.type == EFX_BOARD_SFE4001)
+		if (efx->board_info.type == FALCON_BOARD_SFE4001)
 			err = sfe4001_poweron(efx);
 		else
 			err = sfn4111t_reset(efx);

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  parent reply	other threads:[~2009-10-23 18:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-23 18:27 [PATCH 00/27] sfc: Cleanup and preparation for new hardware Ben Hutchings
2009-10-23 18:28 ` [PATCH 01/27] sfc: Remove redundant header gmii.h Ben Hutchings
2009-10-23 18:28 ` [PATCH 02/27] sfc: Remove redundant hardware initialisation Ben Hutchings
2009-10-23 18:29 ` Ben Hutchings [this message]
2009-10-23 18:29 ` [PATCH 04/27] sfc: Merge sfe4001.c into falcon_boards.c Ben Hutchings
2009-10-23 18:29 ` [PATCH 05/27] sfc: Remove boards.h, moving last remaining declaration to falcon.h Ben Hutchings
2009-10-23 18:30 ` [PATCH 06/27] sfc: Remove versioned bitfield macros Ben Hutchings
2009-10-23 18:30 ` [PATCH 07/27] sfc: Move RX data FIFO thresholds out of struct efx_nic_type Ben Hutchings
2009-10-23 18:30 ` [PATCH 08/27] sfc: Update hardware definitions for Siena Ben Hutchings
2009-10-23 18:30 ` [PATCH 09/27] sfc: Rename register I/O header and functions used by both Falcon and Siena Ben Hutchings
2009-10-23 18:30 ` [PATCH 10/27] sfc: Eliminate indirect lookups of queue size constants Ben Hutchings
2009-10-23 18:31 ` [PATCH 11/27] sfc: Define DMA address mask explicitly in terms of descriptor field width Ben Hutchings
2009-10-23 18:31 ` [PATCH 12/27] sfc: Move all TX DMA length limiting into tx.c Ben Hutchings
2009-10-23 18:31 ` [PATCH 13/27] sfc: Merge struct efx_blinker into struct efx_board Ben Hutchings
2009-10-23 18:31 ` [PATCH 14/27] sfc: Change order of device removal to reverse of probe order Ben Hutchings
2009-10-23 18:31 ` [PATCH 15/27] sfc: Remove declarations of nonexistent functions Ben Hutchings
2009-10-23 18:31 ` [PATCH 16/27] sfc: Move efx_xmit_done() declaration into correct stanza Ben Hutchings
2009-10-23 18:32 ` [PATCH 17/27] sfc: Move shared members of struct falcon_nic_data into struct efx_nic Ben Hutchings
2009-10-23 18:32 ` [PATCH 18/27] sfc: Maintain interrupt moderation values in ticks, not microseconds Ben Hutchings
2009-10-23 18:32 ` [PATCH 19/27] sfc: Removed kernel-doc for nonexistent member of efx_phy_operations Ben Hutchings
2009-10-23 18:32 ` [PATCH 20/27] sfc: Remove pointless abstraction of memory BAR number Ben Hutchings
2009-10-23 18:32 ` [PATCH 21/27] sfc: Merge falcon_probe_phy() into falcon_probe_port() Ben Hutchings
2009-10-23 18:32 ` [PATCH 22/27] sfc: Remove incorrect assertion from efx_pci_remove_main() Ben Hutchings
2009-10-23 18:33 ` [PATCH 23/27] sfc: Remove unnecessary tests of efx->membase Ben Hutchings
2009-10-23 18:33 ` [PATCH 24/27] sfc: Move MTD probe after netdev registration and name allocation Ben Hutchings
2009-10-23 18:33 ` [PATCH 25/27] sfc: Merge efx_fc_resolve() into efx_mdio_get_pause() Ben Hutchings
2009-10-23 18:33 ` [PATCH 26/27] sfc: Remove unused code for non-autoneg speed/duplex switching Ben Hutchings
2009-10-23 18:33 ` [PATCH 27/27] sfc: Rename 'xfp' file and functions to reflect reality Ben Hutchings
2009-10-24 11:29 ` [PATCH 00/27] sfc: Cleanup and preparation for new hardware David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256322556.2785.9.camel@achroite \
    --to=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.