added add_multi/rem_multi to net_devices. Glued the interface protocol multicast handling with net_device via add_multi/rem_multi.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20947 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Hugo Santos 2007-05-01 12:26:03 +00:00
parent 8465a06910
commit 954038303d
4 changed files with 26 additions and 14 deletions

View File

@ -55,10 +55,8 @@ struct net_device_module_info {
status_t (*set_promiscuous)(struct net_device *device, bool promiscuous);
status_t (*set_media)(struct net_device *device, uint32 media);
status_t (*get_multicast_addrs)(struct net_device *device,
net_hardware_address **addressArray, uint32 count);
status_t (*set_multicast_addrs)(struct net_device *device,
const net_hardware_address **addressArray, uint32 count);
status_t (*add_multi)(struct net_device *device, const sockaddr *);
status_t (*rem_multi)(struct net_device *device, const sockaddr *);
};
#endif // NET_DEVICE_H

View File

@ -380,8 +380,7 @@ ethernet_set_media(net_device *device, uint32 media)
status_t
ethernet_get_multicast_addrs(struct net_device *device,
net_hardware_address **addressArray, uint32 count)
ethernet_add_multi(struct net_device *device, const sockaddr *address)
{
// TODO: see etherpci driver for details
return EOPNOTSUPP;
@ -389,8 +388,7 @@ ethernet_get_multicast_addrs(struct net_device *device,
status_t
ethernet_set_multicast_addrs(struct net_device *device,
const net_hardware_address **addressArray, uint32 count)
ethernet_rem_multi(struct net_device *device, const sockaddr *address)
{
// TODO: see etherpci driver for details
return EOPNOTSUPP;
@ -463,8 +461,8 @@ net_device_module_info sEthernetModule = {
ethernet_set_mtu,
ethernet_set_promiscuous,
ethernet_set_media,
ethernet_get_multicast_addrs,
ethernet_set_multicast_addrs
ethernet_add_multi,
ethernet_rem_multi,
};
module_info *modules[] = {

View File

@ -192,6 +192,20 @@ loopback_set_media(net_device *device, uint32 media)
}
status_t
loopback_add_multi(net_device *device, const sockaddr *address)
{
return B_OK;
}
status_t
loopback_rem_multi(net_device *device, const sockaddr *address)
{
return B_OK;
}
static status_t
loopback_std_ops(int32 op, ...)
{
@ -222,6 +236,8 @@ net_device_module_info sLoopbackModule = {
loopback_set_mtu,
loopback_set_promiscuous,
loopback_set_media,
loopback_add_multi,
loopback_rem_multi,
};
module_info *modules[] = {

View File

@ -803,8 +803,8 @@ static status_t
interface_protocol_join_multicast(net_datalink_protocol *_protocol,
const sockaddr *address)
{
// TODO
return ENOTSUP;
interface_protocol *protocol = (interface_protocol *)_protocol;
return protocol->device_module->add_multi(protocol->device, address);
}
@ -812,8 +812,8 @@ static status_t
interface_protocol_leave_multicast(net_datalink_protocol *_protocol,
const sockaddr *address)
{
// TODO
return ENOTSUP;
interface_protocol *protocol = (interface_protocol *)_protocol;
return protocol->device_module->rem_multi(protocol->device, address);
}