diff mbox

prism54: set netdev type to "wlan"

Message ID 1383939584.29096.10.camel@dcbw.foobar.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Williams Nov. 8, 2013, 7:39 p.m. UTC
Userspace uses the netdev devtype for stuff like device naming and type
detection.  Be nice and set it.  Remove the pointless #if/#endif around
SET_NETDEV_DEV too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
---

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Larry Finger Nov. 9, 2013, 2:20 a.m. UTC | #1
On 11/08/2013 01:39 PM, Dan Williams wrote:
> Userspace uses the netdev devtype for stuff like device naming and type
> detection.  Be nice and set it.  Remove the pointless #if/#endif around
> SET_NETDEV_DEV too.
>
> Signed-off-by: Dan Williams <dcbw@redhat.com>

Should this be sent to Stable?

Larry

> ---
> diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
> index 5970ff6..d498b02 100644
> --- a/drivers/net/wireless/prism54/islpci_dev.c
> +++ b/drivers/net/wireless/prism54/islpci_dev.c
> @@ -807,27 +807,30 @@ static const struct net_device_ops islpci_netdev_ops = {
>   	.ndo_start_xmit		= islpci_eth_transmit,
>   	.ndo_tx_timeout		= islpci_eth_tx_timeout,
>   	.ndo_set_mac_address 	= prism54_set_mac_address,
>   	.ndo_change_mtu		= eth_change_mtu,
>   	.ndo_validate_addr	= eth_validate_addr,
>   };
>
> +static struct device_type wlan_type = {
> +	.name	= "wlan",
> +};
> +
>   struct net_device *
>   islpci_setup(struct pci_dev *pdev)
>   {
>   	islpci_private *priv;
>   	struct net_device *ndev = alloc_etherdev(sizeof (islpci_private));
>
>   	if (!ndev)
>   		return ndev;
>
>   	pci_set_drvdata(pdev, ndev);
> -#if defined(SET_NETDEV_DEV)
>   	SET_NETDEV_DEV(ndev, &pdev->dev);
> -#endif
> +	SET_NETDEV_DEVTYPE(ndev, &wlan_type);
>
>   	/* setup the structure members */
>   	ndev->base_addr = pci_resource_start(pdev, 0);
>   	ndev->irq = pdev->irq;
>
>   	/* initialize the function pointers */
>   	ndev->netdev_ops = &islpci_netdev_ops;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Williams Nov. 11, 2013, 2:55 p.m. UTC | #2
On Fri, 2013-11-08 at 20:20 -0600, Larry Finger wrote:
> On 11/08/2013 01:39 PM, Dan Williams wrote:
> > Userspace uses the netdev devtype for stuff like device naming and type
> > detection.  Be nice and set it.  Remove the pointless #if/#endif around
> > SET_NETDEV_DEV too.
> >
> > Signed-off-by: Dan Williams <dcbw@redhat.com>
> 
> Should this be sent to Stable?

Probably, yeah.

Dan

> Larry
> 
> > ---
> > diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
> > index 5970ff6..d498b02 100644
> > --- a/drivers/net/wireless/prism54/islpci_dev.c
> > +++ b/drivers/net/wireless/prism54/islpci_dev.c
> > @@ -807,27 +807,30 @@ static const struct net_device_ops islpci_netdev_ops = {
> >   	.ndo_start_xmit		= islpci_eth_transmit,
> >   	.ndo_tx_timeout		= islpci_eth_tx_timeout,
> >   	.ndo_set_mac_address 	= prism54_set_mac_address,
> >   	.ndo_change_mtu		= eth_change_mtu,
> >   	.ndo_validate_addr	= eth_validate_addr,
> >   };
> >
> > +static struct device_type wlan_type = {
> > +	.name	= "wlan",
> > +};
> > +
> >   struct net_device *
> >   islpci_setup(struct pci_dev *pdev)
> >   {
> >   	islpci_private *priv;
> >   	struct net_device *ndev = alloc_etherdev(sizeof (islpci_private));
> >
> >   	if (!ndev)
> >   		return ndev;
> >
> >   	pci_set_drvdata(pdev, ndev);
> > -#if defined(SET_NETDEV_DEV)
> >   	SET_NETDEV_DEV(ndev, &pdev->dev);
> > -#endif
> > +	SET_NETDEV_DEVTYPE(ndev, &wlan_type);
> >
> >   	/* setup the structure members */
> >   	ndev->base_addr = pci_resource_start(pdev, 0);
> >   	ndev->irq = pdev->irq;
> >
> >   	/* initialize the function pointers */
> >   	ndev->netdev_ops = &islpci_netdev_ops;
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wireless/prism54/islpci_dev.c b/drivers/net/wireless/prism54/islpci_dev.c
index 5970ff6..d498b02 100644
--- a/drivers/net/wireless/prism54/islpci_dev.c
+++ b/drivers/net/wireless/prism54/islpci_dev.c
@@ -807,27 +807,30 @@  static const struct net_device_ops islpci_netdev_ops = {
 	.ndo_start_xmit		= islpci_eth_transmit,
 	.ndo_tx_timeout		= islpci_eth_tx_timeout,
 	.ndo_set_mac_address 	= prism54_set_mac_address,
 	.ndo_change_mtu		= eth_change_mtu,
 	.ndo_validate_addr	= eth_validate_addr,
 };
 
+static struct device_type wlan_type = {
+	.name	= "wlan",
+};
+
 struct net_device *
 islpci_setup(struct pci_dev *pdev)
 {
 	islpci_private *priv;
 	struct net_device *ndev = alloc_etherdev(sizeof (islpci_private));
 
 	if (!ndev)
 		return ndev;
 
 	pci_set_drvdata(pdev, ndev);
-#if defined(SET_NETDEV_DEV)
 	SET_NETDEV_DEV(ndev, &pdev->dev);
-#endif
+	SET_NETDEV_DEVTYPE(ndev, &wlan_type);
 
 	/* setup the structure members */
 	ndev->base_addr = pci_resource_start(pdev, 0);
 	ndev->irq = pdev->irq;
 
 	/* initialize the function pointers */
 	ndev->netdev_ops = &islpci_netdev_ops;