netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Pisati <p.pisati@gmail.com>
To: netdev@vger.kernel.org
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Kristoffer Glembo <kristoffer@gaisler.com>
Subject: [PATCH 3/6] ksz884x: remove mac address handling as a module parameter
Date: Tue, 23 Oct 2012 19:15:30 +0200	[thread overview]
Message-ID: <1351012533-3524-4-git-send-email-p.pisati@gmail.com> (raw)
In-Reply-To: <1351012533-3524-1-git-send-email-p.pisati@gmail.com>

Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
---
 drivers/net/ethernet/micrel/ksz884x.c |   57 ---------------------------------
 1 file changed, 57 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 4b9f4bd..c70a1fc 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -6739,9 +6739,6 @@ static void dev_monitor(unsigned long ptr)
 
 static int msg_enable;
 
-static char *macaddr = ":";
-static char *mac1addr = ":";
-
 /*
  * This enables multiple network device mode for KSZ8842, which contains a
  * switch with two physical ports.  Some users like to take control of the
@@ -6852,51 +6849,6 @@ struct platform_info {
 
 static int net_device_present;
 
-static void get_mac_addr(struct dev_info *hw_priv, u8 *macaddr, int port)
-{
-	int i;
-	int j;
-	int got_num;
-	int num;
-
-	i = j = num = got_num = 0;
-	while (j < MAC_ADDR_LEN) {
-		if (macaddr[i]) {
-			int digit;
-
-			got_num = 1;
-			digit = hex_to_bin(macaddr[i]);
-			if (digit >= 0)
-				num = num * 16 + digit;
-			else if (':' == macaddr[i])
-				got_num = 2;
-			else
-				break;
-		} else if (got_num)
-			got_num = 2;
-		else
-			break;
-		if (2 == got_num) {
-			if (MAIN_PORT == port) {
-				hw_priv->hw.override_addr[j++] = (u8) num;
-				hw_priv->hw.override_addr[5] +=
-					hw_priv->hw.id;
-			} else {
-				hw_priv->hw.ksz_switch->other_addr[j++] =
-					(u8) num;
-				hw_priv->hw.ksz_switch->other_addr[5] +=
-					hw_priv->hw.id;
-			}
-			num = got_num = 0;
-		}
-		i++;
-	}
-	if (MAC_ADDR_LEN == j) {
-		if (MAIN_PORT == port)
-			hw_priv->hw.mac_override = 1;
-	}
-}
-
 #define KS884X_DMA_MASK			(~0x0UL)
 
 static void read_other_addr(struct ksz_hw *hw)
@@ -7050,9 +7002,6 @@ static int __devinit pcidev_init(struct pci_dev *pdev,
 	for (i = 0; i < TOTAL_PORT_NUM; i++)
 		init_waitqueue_head(&hw_priv->counter[i].counter);
 
-	if (macaddr[0] != ':')
-		get_mac_addr(hw_priv, macaddr, MAIN_PORT);
-
 	/* Read MAC address and initialize override address if not overrided. */
 	hw_read_addr(hw);
 
@@ -7060,8 +7009,6 @@ static int __devinit pcidev_init(struct pci_dev *pdev,
 	if (hw->dev_count > 1) {
 		memcpy(sw->other_addr, hw->override_addr, MAC_ADDR_LEN);
 		read_other_addr(hw);
-		if (mac1addr[0] != ':')
-			get_mac_addr(hw_priv, mac1addr, OTHER_PORT);
 	}
 
 	hw_setup(hw);
@@ -7276,13 +7223,9 @@ MODULE_LICENSE("GPL");
 module_param_named(message, msg_enable, int, 0);
 MODULE_PARM_DESC(message, "Message verbosity level (0=none, 31=all)");
 
-module_param(macaddr, charp, 0);
-module_param(mac1addr, charp, 0);
 module_param(fast_aging, int, 0);
 module_param(multi_dev, int, 0);
 module_param(stp, int, 0);
-MODULE_PARM_DESC(macaddr, "MAC address");
-MODULE_PARM_DESC(mac1addr, "Second MAC address");
 MODULE_PARM_DESC(fast_aging, "Fast aging");
 MODULE_PARM_DESC(multi_dev, "Multiple device interfaces");
 MODULE_PARM_DESC(stp, "STP support");
-- 
1.7.9.5

  parent reply	other threads:[~2012-10-23 17:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 17:15 [PATCH 0/6] kernel parameters: introduce "macaddr" to set mac address Paolo Pisati
2012-10-23 17:15 ` [PATCH 1/6] macaddr kernel bootargs implementation Paolo Pisati
2012-10-23 17:15 ` [PATCH 2/6] stmmac: remove mac address handling as a module parameter Paolo Pisati
2012-10-23 17:15 ` Paolo Pisati [this message]
2012-10-23 17:15 ` [PATCH 4/6] greth: " Paolo Pisati
2012-10-23 17:15 ` [PATCH 5/6] sunhme: " Paolo Pisati
2012-10-23 17:15 ` [PATCH 6/6] fec: " Paolo Pisati
2012-10-23 17:20 ` [PATCH 0/6] kernel parameters: introduce "macaddr" to set mac address David Miller
2012-10-24  8:07   ` Paolo Pisati

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=1351012533-3524-4-git-send-email-p.pisati@gmail.com \
    --to=p.pisati@gmail.com \
    --cc=kristoffer@gaisler.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).