Message ID | 1512369428-20455-6-git-send-email-subashab@codeaurora.org |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
Series | net: qualcomm: rmnet: Configuration options | expand |
On Sun, 2017-12-03 at 23:37 -0700, Subash Abhinov Kasiviswanathan wrote: > Add an option to configure the rmnet aggregation and command features > on device creation. This is achieved by using the vlan flags option. Does this overload the VLAN flags item with different meanings than VLAN_FLAG_* that are specific to rmnet? Dan > Signed-off-by: Subash Abhinov Kasiviswanathan > <subashab@codeaurora.org> > --- > drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 16 > +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > index 5e530db..2f5f661 100644 > --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c > @@ -177,11 +177,20 @@ static int rmnet_newlink(struct net *src_net, > struct net_device *dev, > if (err) > goto err2; > > - netdev_dbg(dev, "data format [ingress 0x%08X]\n", > ingress_format); > - port->ingress_data_format = ingress_format; > port->rmnet_mode = mode; > > hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]); > + > + if (data[IFLA_VLAN_FLAGS]) { > + struct ifla_vlan_flags *flags; > + > + flags = nla_data(data[IFLA_VLAN_FLAGS]); > + ingress_format = flags->flags & flags->mask; > + } > + > + netdev_dbg(dev, "data format [ingress 0x%08X]\n", > ingress_format); > + port->ingress_data_format = ingress_format; > + > return 0; > > err2: > @@ -312,7 +321,8 @@ static int rmnet_rtnl_validate(struct nlattr > *tb[], struct nlattr *data[], > > static size_t rmnet_get_size(const struct net_device *dev) > { > - return nla_total_size(2); /* IFLA_VLAN_ID */ > + return nla_total_size(2) /* IFLA_VLAN_ID */ + > + nla_total_size(sizeof(struct ifla_vlan_flags)); /* > IFLA_VLAN_FLAGS */ > } > > struct rtnl_link_ops rmnet_link_ops __read_mostly = {
On 2017-12-08 09:26, Dan Williams wrote: > On Sun, 2017-12-03 at 23:37 -0700, Subash Abhinov Kasiviswanathan > wrote: >> Add an option to configure the rmnet aggregation and command features >> on device creation. This is achieved by using the vlan flags option. > > Does this overload the VLAN flags item with different meanings than > VLAN_FLAG_* that are specific to rmnet? > > Dan Hi Dan Yes, that's right. I am using it to configure rmnet specific features.
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c index 5e530db..2f5f661 100644 --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c @@ -177,11 +177,20 @@ static int rmnet_newlink(struct net *src_net, struct net_device *dev, if (err) goto err2; - netdev_dbg(dev, "data format [ingress 0x%08X]\n", ingress_format); - port->ingress_data_format = ingress_format; port->rmnet_mode = mode; hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]); + + if (data[IFLA_VLAN_FLAGS]) { + struct ifla_vlan_flags *flags; + + flags = nla_data(data[IFLA_VLAN_FLAGS]); + ingress_format = flags->flags & flags->mask; + } + + netdev_dbg(dev, "data format [ingress 0x%08X]\n", ingress_format); + port->ingress_data_format = ingress_format; + return 0; err2: @@ -312,7 +321,8 @@ static int rmnet_rtnl_validate(struct nlattr *tb[], struct nlattr *data[], static size_t rmnet_get_size(const struct net_device *dev) { - return nla_total_size(2); /* IFLA_VLAN_ID */ + return nla_total_size(2) /* IFLA_VLAN_ID */ + + nla_total_size(sizeof(struct ifla_vlan_flags)); /* IFLA_VLAN_FLAGS */ } struct rtnl_link_ops rmnet_link_ops __read_mostly = {
Add an option to configure the rmnet aggregation and command features on device creation. This is achieved by using the vlan flags option. Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org> --- drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)