Re: [PATCH v4 5/5] wifi: wilc1000: Add WILC3000 support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/9/24 10:31, Kalle Valo wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> <Ajay.Kathat@xxxxxxxxxxxxx> writes:
> 
>> On 9/9/24 02:35, Kalle Valo wrote:
>>
>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>>>
>>> Marek Vasut <marex@xxxxxxx> writes:
>>>
>>>> From: Ajay Singh <ajay.kathat@xxxxxxxxxxxxx>
>>>>
>>>> Add support for the WILC3000 chip. The chip is similar to WILC1000,
>>>> except that the register layout is slightly different and it does
>>>> not support WPA3/SAE.
>>>>
>>>> Signed-off-by: Ajay Singh <ajay.kathat@xxxxxxxxxxxxx>
>>>> Signed-off-by: Marek Vasut <marex@xxxxxxx>
>>>
>>> [...]
>>>
>>>> --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c
>>>> +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c
>>>> @@ -313,6 +313,13 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
>>>>
>>>>       vif->connecting = true;
>>>>
>>>> +     if (sme->auth_type == NL80211_AUTHTYPE_SAE &&
>>>> +         is_wilc3000(vif->wilc->chipid)) {
>>>> +             netdev_err(dev, "WILC3000: WPA3 not supported\n");
>>>> +             ret = -EOPNOTSUPP;
>>>> +             goto out_error;
>>>> +     }
>>>
>>> This looks wrong. If wilc3000 doesn't support SAE you shouldn't
>>> advertise NL80211_FEATURE_SAE to user space. I think the check for
>>> wilc3000 should be in wilc_create_wiphy():
>>>
>>
>> Actually, the chip ID is not available when wilc_create_wiphy() is called but
>> is set later in the device probe function. Therefore, adding the
>> 'is_wilc3000(vif->wilc->chipid)' condition may not work as expected.
>> Also, I think there is no API to change "wiphy->features" after wiphy is
>> registered to set it later when chip ID information is available.
> 
> Sounds like the driver is doing something funky in the registration, the
> idea is that the device capabilities are probed before calling
> wiphy_register().
> 

Agree, this approach will configure the wiphy based on connected device.

>> Does it make sense to add a module parameter for device type(wilc1000 or
>> wilc3000) to address device-specific featurization.
> 
> We don't do hacks like that in upstream, it's expected that the driver
> does this all automatically.

Marek has already submitted the patch to delay calling wiphy_register() so it
should work at run time for both the devices.
I'm just curious to know for which scenario the module parameters should be
used. Can it be used for enabling or disabling any feature, configuring any
parameters, instead of complete device-specific featurization.


Regards,
Ajay




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux