diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-09-20 21:18:30 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-09-20 21:23:23 +0200 |
commit | e58f5b6e2ef7ec859b799ba3d58914443ae47efe (patch) | |
tree | 3f7422f1423c3ccf039c92ab1c309454d2deb446 /pfinet/ethernet.c | |
parent | 8e5239628b427facba761194ad655c1c908e146b (diff) |
Add support for setting actual device flags
* pfinet/ethernet.c (ethernet_change_flags): New function.
* pfinet/pfinet.h (ethernet_change_flags): New declaration.
* pfinet/iioctl-ops.c (S_iioctl_siocsifflags): Also call
`ethernet_change_flags' after calling `dev_change_flags'.
Diffstat (limited to 'pfinet/ethernet.c')
-rw-r--r-- | pfinet/ethernet.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pfinet/ethernet.c b/pfinet/ethernet.c index d37b90dd..dab5c56f 100644 --- a/pfinet/ethernet.c +++ b/pfinet/ethernet.c @@ -199,6 +199,22 @@ ethernet_xmit (struct sk_buff *skb, struct device *dev) return 0; } +/* Set device flags (e.g. promiscuous) */ +int +ethernet_change_flags (struct device *dev, short flags) +{ + error_t err = 0; +#ifdef NET_FLAGS + int status = flags; + struct ether_device *edev = (struct ether_device *) dev->priv; + err = device_set_status (edev->ether_port, NET_FLAGS, &status, 1); + if (err == D_INVALID_OPERATION) + /* Not supported, ignore. */ + err = 0; +#endif + return err; +} + void setup_ethernet_device (char *name, struct device **device) { |