Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186584
b: refs/heads/master
c: a9c2910
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Lunn authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 4651e50 commit 8e63819
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 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: e70171957a3ac67fd62af0c66efe7b7749121899
refs/heads/master: a9c2910aa15c5b2559e80d1406176f8456d3e34e
13 changes: 11 additions & 2 deletions trunk/drivers/staging/batman-adv/soft-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,18 @@ struct net_device_stats *interface_stats(struct net_device *dev)
return &priv->stats;
}

int interface_set_mac_addr(struct net_device *dev, void *addr)
int interface_set_mac_addr(struct net_device *dev, void *p)
{
return -EBUSY;
struct sockaddr *addr = p;

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

hna_local_remove(dev->dev_addr, "mac address changed");
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
hna_local_add(dev->dev_addr);

return 0;
}

int interface_change_mtu(struct net_device *dev, int new_mtu)
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/staging/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ static void hna_local_del(struct hna_local_entry *hna_local_entry,
_hna_local_del(hna_local_entry);
}

void hna_local_remove(uint8_t *addr, char *message)
{
struct hna_local_entry *hna_local_entry;
unsigned long flags;

spin_lock_irqsave(&hna_local_hash_lock, flags);

hna_local_entry = (struct hna_local_entry *)
hash_find(hna_local_hash, addr);
if (hna_local_entry)
hna_local_del(hna_local_entry, message);

spin_unlock_irqrestore(&hna_local_hash_lock, flags);
}

void hna_local_purge(struct work_struct *work)
{
struct hna_local_entry *hna_local_entry;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/batman-adv/translation-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

int hna_local_init(void);
void hna_local_add(uint8_t *addr);
void hna_local_remove(uint8_t *addr, char *message);
int hna_local_fill_buffer(unsigned char *buff, int buff_len);
int hna_local_fill_buffer_text(unsigned char *buff, int buff_len);
void hna_local_purge(struct work_struct *work);
Expand Down

0 comments on commit 8e63819

Please sign in to comment.