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:
@@ -55,10 +55,8 @@ struct net_device_module_info {
|
|||||||
status_t (*set_promiscuous)(struct net_device *device, bool promiscuous);
|
status_t (*set_promiscuous)(struct net_device *device, bool promiscuous);
|
||||||
status_t (*set_media)(struct net_device *device, uint32 media);
|
status_t (*set_media)(struct net_device *device, uint32 media);
|
||||||
|
|
||||||
status_t (*get_multicast_addrs)(struct net_device *device,
|
status_t (*add_multi)(struct net_device *device, const sockaddr *);
|
||||||
net_hardware_address **addressArray, uint32 count);
|
status_t (*rem_multi)(struct net_device *device, const sockaddr *);
|
||||||
status_t (*set_multicast_addrs)(struct net_device *device,
|
|
||||||
const net_hardware_address **addressArray, uint32 count);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NET_DEVICE_H
|
#endif // NET_DEVICE_H
|
||||||
|
|||||||
@@ -380,8 +380,7 @@ ethernet_set_media(net_device *device, uint32 media)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ethernet_get_multicast_addrs(struct net_device *device,
|
ethernet_add_multi(struct net_device *device, const sockaddr *address)
|
||||||
net_hardware_address **addressArray, uint32 count)
|
|
||||||
{
|
{
|
||||||
// TODO: see etherpci driver for details
|
// TODO: see etherpci driver for details
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
@@ -389,8 +388,7 @@ ethernet_get_multicast_addrs(struct net_device *device,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ethernet_set_multicast_addrs(struct net_device *device,
|
ethernet_rem_multi(struct net_device *device, const sockaddr *address)
|
||||||
const net_hardware_address **addressArray, uint32 count)
|
|
||||||
{
|
{
|
||||||
// TODO: see etherpci driver for details
|
// TODO: see etherpci driver for details
|
||||||
return EOPNOTSUPP;
|
return EOPNOTSUPP;
|
||||||
@@ -463,8 +461,8 @@ net_device_module_info sEthernetModule = {
|
|||||||
ethernet_set_mtu,
|
ethernet_set_mtu,
|
||||||
ethernet_set_promiscuous,
|
ethernet_set_promiscuous,
|
||||||
ethernet_set_media,
|
ethernet_set_media,
|
||||||
ethernet_get_multicast_addrs,
|
ethernet_add_multi,
|
||||||
ethernet_set_multicast_addrs
|
ethernet_rem_multi,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_info *modules[] = {
|
module_info *modules[] = {
|
||||||
|
|||||||
@@ -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
|
static status_t
|
||||||
loopback_std_ops(int32 op, ...)
|
loopback_std_ops(int32 op, ...)
|
||||||
{
|
{
|
||||||
@@ -222,6 +236,8 @@ net_device_module_info sLoopbackModule = {
|
|||||||
loopback_set_mtu,
|
loopback_set_mtu,
|
||||||
loopback_set_promiscuous,
|
loopback_set_promiscuous,
|
||||||
loopback_set_media,
|
loopback_set_media,
|
||||||
|
loopback_add_multi,
|
||||||
|
loopback_rem_multi,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_info *modules[] = {
|
module_info *modules[] = {
|
||||||
|
|||||||
@@ -803,8 +803,8 @@ static status_t
|
|||||||
interface_protocol_join_multicast(net_datalink_protocol *_protocol,
|
interface_protocol_join_multicast(net_datalink_protocol *_protocol,
|
||||||
const sockaddr *address)
|
const sockaddr *address)
|
||||||
{
|
{
|
||||||
// TODO
|
interface_protocol *protocol = (interface_protocol *)_protocol;
|
||||||
return ENOTSUP;
|
return protocol->device_module->add_multi(protocol->device, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -812,8 +812,8 @@ static status_t
|
|||||||
interface_protocol_leave_multicast(net_datalink_protocol *_protocol,
|
interface_protocol_leave_multicast(net_datalink_protocol *_protocol,
|
||||||
const sockaddr *address)
|
const sockaddr *address)
|
||||||
{
|
{
|
||||||
// TODO
|
interface_protocol *protocol = (interface_protocol *)_protocol;
|
||||||
return ENOTSUP;
|
return protocol->device_module->rem_multi(protocol->device, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user