diff mbox

[v7,29/33] net: brcmfmac - set name assign type

Message ID 1404980258-30853-30-git-send-email-teg@jklm.no (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Tom Gundersen July 10, 2014, 8:17 a.m. UTC
The name is given by the firmware, so we assume it is predictable.

Signed-off-by: Tom Gundersen <teg@jklm.no>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: John Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com
---
 drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Arend van Spriel July 10, 2014, 8:08 p.m. UTC | #1
On 10-07-14 10:17, Tom Gundersen wrote:
> The name is given by the firmware, so we assume it is predictable.

How about the scenario where one would have multiple broadcom wifi
devices in the system. Both driver instances would alloc_netdev with
predictable but also the same ifname. Wondering whether we should ignore
the firmware ifname altogether.

Regards,
Arend

> Signed-off-by: Tom Gundersen <teg@jklm.no>
> Cc: Brett Rudley <brudley@broadcom.com>
> Cc: Arend van Spriel <arend@broadcom.com>
> Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
> Cc: Hante Meuleman <meuleman@broadcom.com>
> Cc: John Linville <linville@tuxdriver.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: brcm80211-dev-list@broadcom.com
> ---
>  drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> index f6990f2..8d32721 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> @@ -201,7 +201,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
>  		brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname,
>  			  emsg->addr);
>  		ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx,
> -				   emsg->ifname, NET_NAME_UNKNOWN, emsg->addr);
> +				   emsg->ifname, NET_NAME_PREDICTABLE,
> +				   emsg->addr);
>  		if (IS_ERR(ifp))
>  			return;
>  		brcmf_fws_add_interface(ifp);
> 

--
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
Tom Gundersen July 10, 2014, 8:24 p.m. UTC | #2
On Thu, Jul 10, 2014 at 10:08 PM, Arend van Spriel <arend@broadcom.com> wrote:
> On 10-07-14 10:17, Tom Gundersen wrote:
>> The name is given by the firmware, so we assume it is predictable.
>
> How about the scenario where one would have multiple broadcom wifi
> devices in the system. Both driver instances would alloc_netdev with
> predictable but also the same ifname. Wondering whether we should ignore
> the firmware ifname altogether.

Hm, that would just fail irrespective of this patch, right? Sounds
like ignoring the firmware names is the right thing to do.

Cheers,

Tom
--
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
Arend van Spriel July 11, 2014, 7:45 a.m. UTC | #3
On 10-07-14 22:24, Tom Gundersen wrote:
> On Thu, Jul 10, 2014 at 10:08 PM, Arend van Spriel <arend@broadcom.com> wrote:
>> On 10-07-14 10:17, Tom Gundersen wrote:
>>> The name is given by the firmware, so we assume it is predictable.
>>
>> How about the scenario where one would have multiple broadcom wifi
>> devices in the system. Both driver instances would alloc_netdev with
>> predictable but also the same ifname. Wondering whether we should ignore
>> the firmware ifname altogether.
> 
> Hm, that would just fail irrespective of this patch, right? Sounds
> like ignoring the firmware names is the right thing to do.

True. I realized that when starting to type my reply. I think at the
moment we never run into the scenario that trigger this code path. Will
make a separate patch for that. Probably on top of your changes.

Regards,
Arend

> Cheers,
> 
> Tom
> 

--
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
John W. Linville July 15, 2014, 7:39 p.m. UTC | #4
I don't seem to have a line with "NET_NAME_UNKNOWN" in this driver
in any of my kernel trees.  What tree are you using for development?

On Thu, Jul 10, 2014 at 10:17:34AM +0200, Tom Gundersen wrote:
> The name is given by the firmware, so we assume it is predictable.
> 
> Signed-off-by: Tom Gundersen <teg@jklm.no>
> Cc: Brett Rudley <brudley@broadcom.com>
> Cc: Arend van Spriel <arend@broadcom.com>
> Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
> Cc: Hante Meuleman <meuleman@broadcom.com>
> Cc: John Linville <linville@tuxdriver.com>
> Cc: linux-wireless@vger.kernel.org
> Cc: brcm80211-dev-list@broadcom.com
> ---
>  drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> index f6990f2..8d32721 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> @@ -201,7 +201,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
>  		brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname,
>  			  emsg->addr);
>  		ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx,
> -				   emsg->ifname, NET_NAME_UNKNOWN, emsg->addr);
> +				   emsg->ifname, NET_NAME_PREDICTABLE,
> +				   emsg->addr);
>  		if (IS_ERR(ifp))
>  			return;
>  		brcmf_fws_add_interface(ifp);
> -- 
> 1.9.3
> 
>
Tom Gundersen July 15, 2014, 7:57 p.m. UTC | #5
On Tue, Jul 15, 2014 at 9:39 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> I don't seem to have a line with "NET_NAME_UNKNOWN" in this driver
> in any of my kernel trees.  What tree are you using for development?

This was patch part of the series introducing NET_NAME_UNKNOWN [0].
I'll resubmit this patch once the earlier patches introducing the
infrastructure have been applied.

Cheers,

Tom

[0]: <https://lkml.org/lkml/2014/7/10/94>.

> On Thu, Jul 10, 2014 at 10:17:34AM +0200, Tom Gundersen wrote:
>> The name is given by the firmware, so we assume it is predictable.
>>
>> Signed-off-by: Tom Gundersen <teg@jklm.no>
>> Cc: Brett Rudley <brudley@broadcom.com>
>> Cc: Arend van Spriel <arend@broadcom.com>
>> Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
>> Cc: Hante Meuleman <meuleman@broadcom.com>
>> Cc: John Linville <linville@tuxdriver.com>
>> Cc: linux-wireless@vger.kernel.org
>> Cc: brcm80211-dev-list@broadcom.com
>> ---
>>  drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
>> index f6990f2..8d32721 100644
>> --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
>> +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
>> @@ -201,7 +201,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
>>               brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname,
>>                         emsg->addr);
>>               ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx,
>> -                                emsg->ifname, NET_NAME_UNKNOWN, emsg->addr);
>> +                                emsg->ifname, NET_NAME_PREDICTABLE,
>> +                                emsg->addr);
>>               if (IS_ERR(ifp))
>>                       return;
>>               brcmf_fws_add_interface(ifp);
>> --
>> 1.9.3
>>
>>
>
> --
> John W. Linville                Someday the world will need a hero, and you
> linville@tuxdriver.com                  might be all we have.  Be ready.
--
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/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
index f6990f2..8d32721 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c
@@ -201,7 +201,8 @@  static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr,
 		brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname,
 			  emsg->addr);
 		ifp = brcmf_add_if(drvr, ifevent->bssidx, ifevent->ifidx,
-				   emsg->ifname, NET_NAME_UNKNOWN, emsg->addr);
+				   emsg->ifname, NET_NAME_PREDICTABLE,
+				   emsg->addr);
 		if (IS_ERR(ifp))
 			return;
 		brcmf_fws_add_interface(ifp);