Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82654
b: refs/heads/master
c: 5cea73b
h: refs/heads/master
v: v3
  • Loading branch information
Olof Johansson authored and David S. Miller committed Feb 3, 2008
1 parent 6c40d2d commit 50fde9d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c88559539bd16eae4e9056d4734b3fe8a9858c45
refs/heads/master: 5cea73b0f7d4d49e276b0c4842465890d00de861
28 changes: 28 additions & 0 deletions trunk/drivers/net/pasemi_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,33 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
return 0;
}

static int pasemi_mac_set_mac_addr(struct net_device *dev, void *p)
{
struct pasemi_mac *mac = netdev_priv(dev);
struct sockaddr *addr = p;
unsigned int adr0, adr1;

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

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

adr0 = dev->dev_addr[2] << 24 |
dev->dev_addr[3] << 16 |
dev->dev_addr[4] << 8 |
dev->dev_addr[5];
adr1 = read_mac_reg(mac, PAS_MAC_CFG_ADR1);
adr1 &= ~0xffff;
adr1 |= dev->dev_addr[0] << 8 | dev->dev_addr[1];

pasemi_mac_intf_disable(mac);
write_mac_reg(mac, PAS_MAC_CFG_ADR0, adr0);
write_mac_reg(mac, PAS_MAC_CFG_ADR1, adr1);
pasemi_mac_intf_enable(mac);

return 0;
}

static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
void **tcph, u64 *hdr_flags, void *data)
{
Expand Down Expand Up @@ -1475,6 +1502,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->stop = pasemi_mac_close;
dev->hard_start_xmit = pasemi_mac_start_tx;
dev->set_multicast_list = pasemi_mac_set_rx_mode;
dev->set_mac_address = pasemi_mac_set_mac_addr;

if (err)
goto out;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/pasemi_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ struct pasemi_mac_buffer {
/* MAC CFG register offsets */
enum {
PAS_MAC_CFG_PCFG = 0x80,
PAS_MAC_CFG_ADR0 = 0x8c,
PAS_MAC_CFG_ADR1 = 0x90,
PAS_MAC_CFG_TXP = 0x98,
PAS_MAC_IPC_CHNL = 0x208,
};
Expand Down

0 comments on commit 50fde9d

Please sign in to comment.