int ipoib_open(struct net_device *dev);
int ipoib_add_pkey_attr(struct net_device *dev);
+int ipoib_add_broadcast_scope_attr(struct net_device *dev);
int ipoib_add_umcast_attr(struct net_device *dev);
void ipoib_send(struct net_device *dev, struct sk_buff *skb,
}
static DEVICE_ATTR(broadcast_scope, S_IWUSR | S_IRUGO, show_bcast_scope, set_bcast_scope);
+int ipoib_add_broadcast_scope_attr(struct net_device *dev)
+{
+ return device_create_file(&dev->dev, &dev_attr_broadcast_scope);
+}
+
static ssize_t create_child(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
struct ipoib_dev_priv *ppriv, *priv;
ppriv = netdev_priv(dev);
+ if (ppriv->parent) {
+ dev = ppriv->parent;
+ ppriv = netdev_priv(dev);
+ }
+
/*
* We check the parent device and then all of the child interfaces to make sure
* the Pkey and scope don't match.
goto sysfs_failed;
if (device_create_file(&priv->dev->dev, &dev_attr_delete_child))
goto sysfs_failed;
- if (device_create_file(&priv->dev->dev, &dev_attr_broadcast_scope))
+ if (ipoib_add_broadcast_scope_attr(priv->dev))
goto sysfs_failed;
return priv->dev;
if (device_create_file(&priv->dev->dev, &dev_attr_parent))
goto sysfs_failed;
+ if (ipoib_add_broadcast_scope_attr(priv->dev))
+ goto sysfs_failed;
list_add_tail(&priv->list, &ppriv->child_intfs);