Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194563
b: refs/heads/master
c: fa12abd
h: refs/heads/master
i:
  194561: 1cf3e3c
  194559: d61d5ef
v: v3
  • Loading branch information
Sebastian Andrzej Siewior authored and David S. Miller committed Apr 27, 2010
1 parent 00ba124 commit 50952b5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 145 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 05fceb4ad7e8bf809a2a97061d6273d27d1a8449
refs/heads/master: fa12abd7d3fbaa9f86f97baeb445cb71189ae1d1
144 changes: 0 additions & 144 deletions trunk/drivers/net/sb1250-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@
#include <asm/io.h>
#include <asm/processor.h> /* Processor type for cache alignment. */

/* This is only here until the firmware is ready. In that case,
the firmware leaves the ethernet address in the register for us. */
#ifdef CONFIG_SIBYTE_STANDALONE
#define SBMAC_ETH0_HWADDR "40:00:00:00:01:00"
#define SBMAC_ETH1_HWADDR "40:00:00:00:01:01"
#define SBMAC_ETH2_HWADDR "40:00:00:00:01:02"
#define SBMAC_ETH3_HWADDR "40:00:00:00:01:03"
#endif


/* These identify the driver base version and may not be removed. */
#if 0
static char version1[] __initdata =
"sb1250-mac.c:1.00 1/11/2001 Written by Mitch Lichtenberg\n";
#endif


/* Operational parameters that usually are not changed. */

#define CONFIG_SBMAC_COALESCE
Expand Down Expand Up @@ -2182,85 +2165,6 @@ static void sbmac_setmulti(struct sbmac_softc *sc)
}
}

#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
/**********************************************************************
* SBMAC_PARSE_XDIGIT(str)
*
* Parse a hex digit, returning its value
*
* Input parameters:
* str - character
*
* Return value:
* hex value, or -1 if invalid
********************************************************************* */

static int sbmac_parse_xdigit(char str)
{
int digit;

if ((str >= '0') && (str <= '9'))
digit = str - '0';
else if ((str >= 'a') && (str <= 'f'))
digit = str - 'a' + 10;
else if ((str >= 'A') && (str <= 'F'))
digit = str - 'A' + 10;
else
return -1;

return digit;
}

/**********************************************************************
* SBMAC_PARSE_HWADDR(str,hwaddr)
*
* Convert a string in the form xx:xx:xx:xx:xx:xx into a 6-byte
* Ethernet address.
*
* Input parameters:
* str - string
* hwaddr - pointer to hardware address
*
* Return value:
* 0 if ok, else -1
********************************************************************* */

static int sbmac_parse_hwaddr(char *str, unsigned char *hwaddr)
{
int digit1,digit2;
int idx = 6;

while (*str && (idx > 0)) {
digit1 = sbmac_parse_xdigit(*str);
if (digit1 < 0)
return -1;
str++;
if (!*str)
return -1;

if ((*str == ':') || (*str == '-')) {
digit2 = digit1;
digit1 = 0;
}
else {
digit2 = sbmac_parse_xdigit(*str);
if (digit2 < 0)
return -1;
str++;
}

*hwaddr++ = (digit1 << 4) | digit2;
idx--;

if (*str == '-')
str++;
if (*str == ':')
str++;
}
return 0;
}
#endif

static int sb1250_change_mtu(struct net_device *_dev, int new_mtu)
{
if (new_mtu > ENET_PACKET_SIZE)
Expand Down Expand Up @@ -2770,36 +2674,6 @@ static int __exit sbmac_remove(struct platform_device *pldev)
static struct platform_device **sbmac_pldev;
static int sbmac_max_units;

#if defined(SBMAC_ETH0_HWADDR) || defined(SBMAC_ETH1_HWADDR) || defined(SBMAC_ETH2_HWADDR) || defined(SBMAC_ETH3_HWADDR)
static void __init sbmac_setup_hwaddr(int idx, char *addr)
{
void __iomem *sbm_base;
unsigned long start, end;
uint8_t eaddr[6];
uint64_t val;

if (idx >= sbmac_max_units)
return;

start = A_MAC_CHANNEL_BASE(idx);
end = A_MAC_CHANNEL_BASE(idx + 1) - 1;

sbm_base = ioremap_nocache(start, end - start + 1);
if (!sbm_base) {
printk(KERN_ERR "%s: unable to map device registers\n",
sbmac_string);
return;
}

sbmac_parse_hwaddr(addr, eaddr);
val = sbmac_addr2reg(eaddr);
__raw_writeq(val, sbm_base + R_MAC_ETHERNET_ADDR);
val = __raw_readq(sbm_base + R_MAC_ETHERNET_ADDR);

iounmap(sbm_base);
}
#endif

static int __init sbmac_platform_probe_one(int idx)
{
struct platform_device *pldev;
Expand Down Expand Up @@ -2876,24 +2750,6 @@ static void __init sbmac_platform_probe(void)
return; /* none */
}

/*
* For bringup when not using the firmware, we can pre-fill
* the MAC addresses using the environment variables
* specified in this file (or maybe from the config file?)
*/
#ifdef SBMAC_ETH0_HWADDR
sbmac_setup_hwaddr(0, SBMAC_ETH0_HWADDR);
#endif
#ifdef SBMAC_ETH1_HWADDR
sbmac_setup_hwaddr(1, SBMAC_ETH1_HWADDR);
#endif
#ifdef SBMAC_ETH2_HWADDR
sbmac_setup_hwaddr(2, SBMAC_ETH2_HWADDR);
#endif
#ifdef SBMAC_ETH3_HWADDR
sbmac_setup_hwaddr(3, SBMAC_ETH3_HWADDR);
#endif

sbmac_pldev = kcalloc(sbmac_max_units, sizeof(*sbmac_pldev),
GFP_KERNEL);
if (!sbmac_pldev) {
Expand Down

0 comments on commit 50952b5

Please sign in to comment.