Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135167
b: refs/heads/master
c: bda6a15
h: refs/heads/master
i:
  135165: ea2d8ac
  135163: 57dedc9
  135159: f74aae6
  135151: cd6fd38
  135135: f5f1464
  135103: ec842c8
  135039: a1faa89
  134911: f503982
  134655: a27a407
  134143: 2deca3f
  133119: d1f7ac0
  131071: 5e1d553
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Mar 13, 2009
1 parent 6bf0e0d commit 2e3fa83
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 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: c048aaf4ca854fa67a3bfa9dab5b9ddc5083b3b7
refs/heads/master: bda6a15a0d283d531b865fb7c596bb3ff258e87e
26 changes: 25 additions & 1 deletion trunk/drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb,
#ifdef CONFIG_NET_POLL_CONTROLLER
static void rtl8139_poll_controller(struct net_device *dev);
#endif
static int rtl8139_set_mac_address(struct net_device *dev, void *p);
static int rtl8139_poll(struct napi_struct *napi, int budget);
static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance);
static int rtl8139_close (struct net_device *dev);
Expand Down Expand Up @@ -917,7 +918,7 @@ static const struct net_device_ops rtl8139_netdev_ops = {
.ndo_stop = rtl8139_close,
.ndo_get_stats = rtl8139_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_set_mac_address = rtl8139_set_mac_address,
.ndo_start_xmit = rtl8139_start_xmit,
.ndo_set_multicast_list = rtl8139_set_rx_mode,
.ndo_do_ioctl = netdev_ioctl,
Expand Down Expand Up @@ -2215,6 +2216,29 @@ static void rtl8139_poll_controller(struct net_device *dev)
}
#endif

static int rtl8139_set_mac_address(struct net_device *dev, void *p)
{
struct rtl8139_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
struct sockaddr *addr = p;

if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;

memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);

spin_lock_irq(&tp->lock);

RTL_W8_F(Cfg9346, Cfg9346_Unlock);
RTL_W32_F(MAC0 + 0, cpu_to_le32 (*(u32 *) (dev->dev_addr + 0)));
RTL_W32_F(MAC0 + 4, cpu_to_le32 (*(u32 *) (dev->dev_addr + 4)));
RTL_W8_F(Cfg9346, Cfg9346_Lock);

spin_unlock_irq(&tp->lock);

return 0;
}

static int rtl8139_close (struct net_device *dev)
{
struct rtl8139_private *tp = netdev_priv(dev);
Expand Down

0 comments on commit 2e3fa83

Please sign in to comment.