Re: Add "Intel Centrino Wireless-N 130" support for iwn

2013-08-07 Thread Sylvestre Gallon
On Wed, Aug 7, 2013 at 11:23 PM, Chris Cappuccio  wrote:
> Sylvestre Gallon [ccna@gmail.com] wrote:
>> Hi tech@
>>
>> Here is a diff to allow the iwn driver to work with the intel Wifi Link
>> 130. It works for me(tm) without problems and solve this bug report :
>>
>> Index: sys/dev/pci/if_iwn.c
>> ===
>> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
>> retrieving revision 1.121
>> diff -u -p -u -p -r1.121 if_iwn.c
>> --- sys/dev/pci/if_iwn.c  7 Aug 2013 01:06:35 -   1.121
>> +++ sys/dev/pci/if_iwn.c  7 Aug 2013 09:25:43 -
>> @@ -90,6 +90,8 @@ static const struct pci_matchid iwn_devi
>>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_1030_2 },
>>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_1 },
>>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_2 },
>> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_1 },
>> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_2 },
>>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_1 },
>>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_2 },
>>  };
>
> This part makes sense
>
>> @@ -639,12 +641,8 @@ iwn5000_attach(struct iwn_softc *sc, pci
>>   break;
>>   case IWN_HW_REV_TYPE_6005:
>>   sc->limits = &iwn6000_sensitivity_limits;
>> - if (pid == PCI_PRODUCT_INTEL_WL_1030_1 ||
>> - pid == PCI_PRODUCT_INTEL_WL_1030_2 ||
>> - pid == PCI_PRODUCT_INTEL_WL_6030_1 ||
>> - pid == PCI_PRODUCT_INTEL_WL_6030_2 ||
>> - pid == PCI_PRODUCT_INTEL_WL_6235_1 ||
>> - pid == PCI_PRODUCT_INTEL_WL_6235_2) {
>> + if (pid != PCI_PRODUCT_INTEL_WL_6005_1 &&
>> + pid != PCI_PRODUCT_INTEL_WL_6005_2) {
>>   sc->fwname = "iwn-6030";
>>   sc->sc_flags |= IWN_FLAG_ADV_BT_COEX;
>>   } else
>
> This does not. You are adjusting PCI_PRODUCT_INTEL_crap that has
> nothing to do with WL_130 which is the only hardware you are testing
> with, no?

I have just take example on the freebsd driver :

http://svnweb.freebsd.org/base/head/sys/dev/iwn/if_iwn.c?revision=253937&view=markup

and also check on linux :
http://lxr.linux.no/#linux+v3.10.5/drivers/net/wireless/iwlwifi/iwl-6000.c#L169
http://lxr.linux.no/#linux+v3.10.5/drivers/net/wireless/iwlwifi/pcie/drv.c#L151

If I understand it well only the PCI_PRODUCT_INTEL_WL_6005_{1|2}
products of IWN_HW_REV_TYPE_6005 hw revision needs the "iwn-6005"
firmware. The others one (like the WL_130) needs the "iwn-6030"
firmware. I changed the condition because I was thinking it was more
elegant than adding :

pid == PCI_PRODUCT_INTEL_WL_130_1 ||
pid == PCI_PRODUCT_INTEL_WL_130_2 ||

Cheers,
-- 
Sylvestre Gallon



Re: Add "Intel Centrino Wireless-N 130" support for iwn

2013-08-07 Thread Chris Cappuccio
Sylvestre Gallon [ccna@gmail.com] wrote:
> Hi tech@
> 
> Here is a diff to allow the iwn driver to work with the intel Wifi Link
> 130. It works for me(tm) without problems and solve this bug report : 
> 
> Index: sys/dev/pci/if_iwn.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.121
> diff -u -p -u -p -r1.121 if_iwn.c
> --- sys/dev/pci/if_iwn.c  7 Aug 2013 01:06:35 -   1.121
> +++ sys/dev/pci/if_iwn.c  7 Aug 2013 09:25:43 -
> @@ -90,6 +90,8 @@ static const struct pci_matchid iwn_devi
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_1030_2 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_1 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_2 },
> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_1 },
> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_2 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_1 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_2 },
>  };

This part makes sense

> @@ -639,12 +641,8 @@ iwn5000_attach(struct iwn_softc *sc, pci
>   break;
>   case IWN_HW_REV_TYPE_6005:
>   sc->limits = &iwn6000_sensitivity_limits;
> - if (pid == PCI_PRODUCT_INTEL_WL_1030_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_1030_2 ||
> - pid == PCI_PRODUCT_INTEL_WL_6030_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_6030_2 ||
> - pid == PCI_PRODUCT_INTEL_WL_6235_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_6235_2) {
> + if (pid != PCI_PRODUCT_INTEL_WL_6005_1 &&
> + pid != PCI_PRODUCT_INTEL_WL_6005_2) {
>   sc->fwname = "iwn-6030";
>   sc->sc_flags |= IWN_FLAG_ADV_BT_COEX;
>   } else

This does not. You are adjusting PCI_PRODUCT_INTEL_crap that has
nothing to do with WL_130 which is the only hardware you are testing
with, no?



Re: Add "Intel Centrino Wireless-N 130" support for iwn

2013-08-07 Thread Mark Kettenis
> Date: Wed, 7 Aug 2013 21:26:14 +0200
> From: Sylvestre Gallon 
> 
> Hi tech@
> 
> Here is a diff to allow the iwn driver to work with the intel Wifi Link
> 130. It works for me(tm) without problems and solve this bug report : 
> 
> http://marc.info/?|=openbsd-bugs&m=134586079532510&w=2
> 
> Any OK ?

ok kettenis@

> Index: sys/dev/pci/if_iwn.c
> ===
> RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.121
> diff -u -p -u -p -r1.121 if_iwn.c
> --- sys/dev/pci/if_iwn.c  7 Aug 2013 01:06:35 -   1.121
> +++ sys/dev/pci/if_iwn.c  7 Aug 2013 09:25:43 -
> @@ -90,6 +90,8 @@ static const struct pci_matchid iwn_devi
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_1030_2 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_1 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_2 },
> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_1 },
> + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_2 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_1 },
>   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_2 },
>  };
> @@ -639,12 +641,8 @@ iwn5000_attach(struct iwn_softc *sc, pci
>   break;
>   case IWN_HW_REV_TYPE_6005:
>   sc->limits = &iwn6000_sensitivity_limits;
> - if (pid == PCI_PRODUCT_INTEL_WL_1030_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_1030_2 ||
> - pid == PCI_PRODUCT_INTEL_WL_6030_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_6030_2 ||
> - pid == PCI_PRODUCT_INTEL_WL_6235_1 ||
> - pid == PCI_PRODUCT_INTEL_WL_6235_2) {
> + if (pid != PCI_PRODUCT_INTEL_WL_6005_1 &&
> + pid != PCI_PRODUCT_INTEL_WL_6005_2) {
>   sc->fwname = "iwn-6030";
>   sc->sc_flags |= IWN_FLAG_ADV_BT_COEX;
>   } else
> 
> 



Add "Intel Centrino Wireless-N 130" support for iwn

2013-08-07 Thread Sylvestre Gallon
Hi tech@

Here is a diff to allow the iwn driver to work with the intel Wifi Link
130. It works for me(tm) without problems and solve this bug report : 

http://marc.info/?|=openbsd-bugs&m=134586079532510&w=2

Any OK ?

Cheers,

Index: sys/dev/pci/if_iwn.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.121
diff -u -p -u -p -r1.121 if_iwn.c
--- sys/dev/pci/if_iwn.c7 Aug 2013 01:06:35 -   1.121
+++ sys/dev/pci/if_iwn.c7 Aug 2013 09:25:43 -
@@ -90,6 +90,8 @@ static const struct pci_matchid iwn_devi
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_1030_2 },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_1 },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_100_2 },
+   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_1 },
+   { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_130_2 },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_1 },
{ PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_WL_6235_2 },
 };
@@ -639,12 +641,8 @@ iwn5000_attach(struct iwn_softc *sc, pci
break;
case IWN_HW_REV_TYPE_6005:
sc->limits = &iwn6000_sensitivity_limits;
-   if (pid == PCI_PRODUCT_INTEL_WL_1030_1 ||
-   pid == PCI_PRODUCT_INTEL_WL_1030_2 ||
-   pid == PCI_PRODUCT_INTEL_WL_6030_1 ||
-   pid == PCI_PRODUCT_INTEL_WL_6030_2 ||
-   pid == PCI_PRODUCT_INTEL_WL_6235_1 ||
-   pid == PCI_PRODUCT_INTEL_WL_6235_2) {
+   if (pid != PCI_PRODUCT_INTEL_WL_6005_1 &&
+   pid != PCI_PRODUCT_INTEL_WL_6005_2) {
sc->fwname = "iwn-6030";
sc->sc_flags |= IWN_FLAG_ADV_BT_COEX;
} else