* Re: [PATCH v4 2/4] wcn36xx: Transition driver to SMD client
From: Bjorn Andersson @ 2016-09-08 15:31 UTC (permalink / raw)
To: Kalle Valo
Cc: Eugene Krasnikov, wcn36xx, linux-wireless, netdev, lkml,
Andy Gross, linux-arm-msm
In-Reply-To: <87k2emsi22.fsf@kamboji.qca.qualcomm.com>
On Thu, Sep 8, 2016 at 5:16 AM, Kalle Valo <kvalo@codeaurora.org> wrote:
> Bjorn Andersson <bjorn.andersson@linaro.org> writes:
>
>> The wcn36xx wifi driver follows the life cycle of the WLAN_CTRL SMD
>> channel, as such it should be a SMD client. This patch makes this
>> transition, now that we have the necessary frameworks available.
>>
>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>>
>> Changes since v3:
>> - Made msg_header const in wcn36xx_smd_rsp_process()
>>
>> Changes since v2:
>> - Correct the call to the new ieee80211_scan_completed()
>>
>> drivers/net/wireless/ath/wcn36xx/dxe.c | 16 +++---
>> drivers/net/wireless/ath/wcn36xx/main.c | 79 ++++++++++++++++++++----------
>> drivers/net/wireless/ath/wcn36xx/smd.c | 31 +++++-------
>> drivers/net/wireless/ath/wcn36xx/smd.h | 5 ++
>> drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 21 +++-----
>> 5 files changed, 86 insertions(+), 66 deletions(-)
>
> This doesn't compile for me:
>
I thought I mentioned this in the mail, sorry for missing that.
There is a patch for this issue in linux-next already [1] which is
part of [2], which was part of the pull request to arm-soc for
inclusion in v4.9.
[1] https://patchwork.kernel.org/patch/9272457/
[2] https://git.kernel.org/cgit/linux/kernel/git/agross/linux.git/tag/?h=qcom-drivers-for-4.9
Regards,
Bjorn
^ permalink raw reply
* RE: mwifiex: add PCIe function level reset support
From: Amitkumar Karwar @ 2016-09-08 15:05 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <20160903154016.4BCE56217C@smtp.codeaurora.org>
SGkgS2FsbGUsDQoNCj4gRnJvbTogbGludXgtd2lyZWxlc3Mtb3duZXJAdmdlci5rZXJuZWwub3Jn
IFttYWlsdG86bGludXgtd2lyZWxlc3MtDQo+IG93bmVyQHZnZXIua2VybmVsLm9yZ10gT24gQmVo
YWxmIE9mIEthbGxlIFZhbG8NCj4gU2VudDogU2F0dXJkYXksIFNlcHRlbWJlciAwMywgMjAxNiA5
OjEwIFBNDQo+IFRvOiBBbWl0a3VtYXIgS2Fyd2FyDQo+IENjOiBsaW51eC13aXJlbGVzc0B2Z2Vy
Lmtlcm5lbC5vcmc7IEFtaXRrdW1hciBLYXJ3YXINCj4gU3ViamVjdDogUmU6IG13aWZpZXg6IGFk
ZCBQQ0llIGZ1bmN0aW9uIGxldmVsIHJlc2V0IHN1cHBvcnQNCj4gDQo+IEFtaXRrdW1hciBLYXJ3
YXIgPGFrYXJ3YXJAbWFydmVsbC5jb20+IHdyb3RlOg0KPiA+IFRoaXMgcGF0Y2ggaW1wbGVtZW50
cyBwcmUgYW5kIHBvc3QgRkxSIGhhbmRsZXJzIHRvIHN1cHBvcnQgUENJZSBGTFINCj4gPiBmdW5j
dGlvbmFsaXR5LiBTb2Z0d2FyZSBjbGVhbnVwIGlzIHBlcmZvcm1lZCBpbiBwcmUtRkxSIHdoZXJl
YXMNCj4gPiBmaXJtd2FyZSBpcyBkb3dubG9hZGVkIGFuZCBzb2Z0d2FyZSBpcyByZS1pbml0aWFs
aXNlZCBpbiBwb3N0LUZMUg0KPiA+IGhhbmRsZXIuDQo+ID4NCj4gPiBGb2xsb3dpbmcgY29tbWFu
ZCB0cmlnZ2VycyBGTFIuDQo+ID4gZWNobyAiMSIgPiAvc3lzL2J1cy9wY2kvZGV2aWNlcy8kTlVN
QkVSL3Jlc2V0DQo+ID4NCj4gPiBUaGlzIGZlYXR1cmUgY2FuIGJlIHVzZWQgYXMgYSByZWNvdmVy
eSBtZWNoYW5pc20gd2hlbiBmaXJtd2FyZSBnZXRzDQo+ID4gaGFuZy4NCj4gPg0KPiA+IFNpZ25l
ZC1vZmYtYnk6IEFtaXRrdW1hciBLYXJ3YXIgPGFrYXJ3YXJAbWFydmVsbC5jb20+DQo+IA0KPiBE
b2Vzbid0IGFwcGx5IGFueW1vcmUsIHBsZWFzZSByZWJhc2UuDQo+IA0KPiBBcHBseWluZzogbXdp
ZmlleDogYWRkIFBDSWUgZnVuY3Rpb24gbGV2ZWwgcmVzZXQgc3VwcG9ydA0KPiBmYXRhbDogc2hh
MSBpbmZvcm1hdGlvbiBpcyBsYWNraW5nIG9yIHVzZWxlc3MNCj4gKGRyaXZlcnMvbmV0L3dpcmVs
ZXNzL21hcnZlbGwvbXdpZmlleC9tYWluLmMpLg0KPiBSZXBvc2l0b3J5IGxhY2tzIG5lY2Vzc2Fy
eSBibG9icyB0byBmYWxsIGJhY2sgb24gMy13YXkgbWVyZ2UuDQo+IENhbm5vdCBmYWxsIGJhY2sg
dG8gdGhyZWUtd2F5IG1lcmdlLg0KPiBQYXRjaCBmYWlsZWQgYXQgMDAwMSBtd2lmaWV4OiBhZGQg
UENJZSBmdW5jdGlvbiBsZXZlbCByZXNldCBzdXBwb3J0DQo+IA0KDQpJdCBnZXRzIGFwcGxpZWQg
c21vb3RobHkgaWYgYmVsb3cgcGF0Y2hlcyBhcmUgYXBwbGllZCBmaXJzdC4NCmh0dHBzOi8vcGF0
Y2h3b3JrLmtlcm5lbC5vcmcvcGF0Y2gvOTMxMDQ5OS8gKFt2NSwxLzJdIG13aWZpZXg6IGFkZCBt
YW51ZmFjdHVyaW5nIG1vZGUgc3VwcG9ydCkNCmh0dHBzOi8vcGF0Y2h3b3JrLmtlcm5lbC5vcmcv
cGF0Y2gvOTMxMDUwMS8gKFt2NSwyLzJdIG13aWZpZXg6IGFkZCBjZmc4MDIxMSB0ZXN0bW9kZSBz
dXBwb3J0KQ0KDQpQbGVhc2UgbGV0IG1lIGtub3cgaWYgeW91IHdhbnQgbWUgdG8gcmViYXNlICJQ
Q0llIGZ1bmN0aW9uIGxldmVsIHJlc2V0IHN1cHBvcnQiLiBJbiB0aGF0IGNhc2UgSSBuZWVkIHRv
IHJlYmFzZSBhbmQgc2VuZCBhYm92ZSAyIHBhdGNoZXMgYXMgd2VsbC4NCg0KUmVnYXJkcywNCkFt
aXRrdW1hcg0K
^ permalink raw reply
* Re: Stability connection problems in ath9k kernel 4.7
From: Valerio Passini @ 2016-09-08 14:20 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <2596121.7secQ7hYiJ@automatix>
On gioved=EC 8 settembre 2016 16:11:49 CEST Valerio Passini wrote:
I missed a line in copy-paste, sorry.
Valerio
git bisect start
# good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
# bad: [523d939ef98fd712632d93a5a2b588e477a7565e] Linux 4.7
git bisect bad 523d939ef98fd712632d93a5a2b588e477a7565e
# good: [0694f0c9e20c47063e4237e5f6649ae5ce5a369a] radix tree test suite:=20
remove dependencies on height
git bisect good 0694f0c9e20c47063e4237e5f6649ae5ce5a369a
# good: [e4f7bdc2ec0d0dcc27f7d70db27a620dfdc1f697] Merge branch 'for-4.7-za=
c'=20
of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
git bisect good e4f7bdc2ec0d0dcc27f7d70db27a620dfdc1f697
# bad: [049ec1b5a76d34a6980cccdb7c0baeb4eed7a993] Merge tag 'drm-fixes-for-
v4.7-rc2' of git://people.freedesktop.org/~airlied/linux
git bisect bad 049ec1b5a76d34a6980cccdb7c0baeb4eed7a993
# good: [a10c38a4f385f5d7c173a263ff6bb2d36021b3bb] Merge branch 'for-linus'=
of=20
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
git bisect good a10c38a4f385f5d7c173a263ff6bb2d36021b3bb
# bad: [9ba55cf7cfbfd12a7e914d0d55b7581e896b3f0d] Merge branch 'for-next' o=
f=20
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
git bisect bad 9ba55cf7cfbfd12a7e914d0d55b7581e896b3f0d
# bad: [c61b49c79e1c1d4bc0c2fdc053ef56e65759b5fd] Merge tag 'drm-fixes-v4.7-
rc1' of git://people.freedesktop.org/~airlied/linux
git bisect bad c61b49c79e1c1d4bc0c2fdc053ef56e65759b5fd
# good: [dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6] Merge branch 'misc' of=20
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
git bisect good dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6
# good: [e28e909c36bb5d6319953822d84df00fce7cbd18] Merge tag 'for-linus' of=
=20
git://git.kernel.org/pub/scm/virt/kvm/kvm
git bisect good e28e909c36bb5d6319953822d84df00fce7cbd18
# good: [79b3c7164c18e2fe9e69b0dcc0d45bab7ae3c968] Merge branch 'drm-next-4=
=2E7'=20
of git://people.freedesktop.org/~agd5f/linux into drm-next
git bisect good 79b3c7164c18e2fe9e69b0dcc0d45bab7ae3c968
# bad: [1e8143db755f745a9842984de5e8b423f583aea2] Merge tag 'platform-drive=
rs-
x86-v4.7-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-=
x86
git bisect bad 1e8143db755f745a9842984de5e8b423f583aea2
# good: [afcedebc6a094224973534f43b396bbbf33fe44e] thinkpad_acpi: save=20
kbdlight state on suspend and restore it on resume
git bisect good afcedebc6a094224973534f43b396bbbf33fe44e
# good: [2aac630429d986a43ac59525a4cff47a624dc58e] iommu/vt-d: change intel-
iommu to use IOVA frame numbers
git bisect good 2aac630429d986a43ac59525a4cff47a624dc58e
# bad: [2566278551d3db875bc3bbfc41b42f2e80392108] Merge git://
git.infradead.org/intel-iommu
git bisect bad 2566278551d3db875bc3bbfc41b42f2e80392108
# bad: [22e2f9fa63b092923873fc8a52955151f4d83274] iommu/vt-d: Use per-cpu I=
OVA=20
caching
git bisect bad 22e2f9fa63b092923873fc8a52955151f4d83274
# bad: [9257b4a206fc0229dd5f84b78e4d1ebf3f91d270] iommu/iova: introduce per-
cpu caching to iova allocation
git bisect bad 9257b4a206fc0229dd5f84b78e4d1ebf3f91d270
# first bad commit: [9257b4a206fc0229dd5f84b78e4d1ebf3f91d270] iommu/iova:=
=20
introduce per-cpu caching to iova allocation
^ permalink raw reply
* Re: Stability connection problems in ath9k kernel 4.7
From: Valerio Passini @ 2016-09-08 14:11 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless
In-Reply-To: <87wpio155z.fsf@purkki.adurom.net>
On mercoled=EC 7 settembre 2016 11:32:24 CEST Kalle Valo wrote:
> Valerio Passini <valerio.passini@unicam.it> writes:
> > I have found some connection problems since 4.7 release using ath9k that
> > turn the wifi pretty useless, I think it might be something in the power
> > management because the signal seems really low. Previously, up to kernel
> > 4.6.7 everything worked very well.
> >=20
> > This is a sample of dmesg in kernel 4.7.2:
> > 239.898935] wlp4s0: authenticate with XX:XX:XX:XX:XX:XX
> >=20
> > [ 239.919995] wlp4s0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
> > [ 239.931877] wlp4s0: authenticated
> > [ 239.932357] wlp4s0: associate with XX:XX:XX:XX:XX:XX (try 1/3)
> > [ 239.942171] wlp4s0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=3D0x=
431
> > status=3D0 aid=3D2)
> > [ 239.942301] wlp4s0: associated
> > [ 244.802853] ath: phy0: DMA failed to stop in 10 ms AR_CR=3D0x00000024
> > AR_DIAG_SW=3D0x02000020 DMADBG_7=3D0x0000
> > 6100
> > [ 245.931832] wlp4s0: authenticate with XX:XX:XX:XX:XX:XX
> > [ 245.953028] wlp4s0: send auth to XX:XX:XX:XX:XX:XX (try 1/3)
> > [ 245.958702] wlp4s0: authenticated
> > [ 245.960386] wlp4s0: associate withXX:XX:XX:XX:XX:XX (try 1/3)
> > [ 245.980543] wlp4s0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=3D0x=
431
> > status=3D0 aid=3D2)
> >=20
> > lspci on 4.6.7 kernel:
> > 04:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network
> > Adapter (rev 01)
> >=20
> > Subsystem: AzureWave AR9485 Wireless Network Adapter
> > Flags: bus master, fast devsel, latency 0, IRQ 18
> > Memory at f7900000 (64-bit, non-prefetchable) [size=3D512K]
> > Expansion ROM at f7980000 [disabled] [size=3D64K]
> > Capabilities: [40] Power Management version 2
> > Capabilities: [50] MSI: Enable- Count=3D1/4 Maskable+ 64bit+
> > Capabilities: [70] Express Endpoint, MSI 00
> > Capabilities: [100] Advanced Error Reporting
> > Capabilities: [140] Virtual Channel
> > Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
> > Kernel driver in use: ath9k
> > Kernel modules: ath9k
> >=20
> > Probably you need some debugging output, but before recompiling the ker=
nel
> > I would like to know if you are interested in any kind of help from me
> > and what steps I should take (I'm able to help in testing patches but I=
'm
> > not familiar with git). Thank you
>=20
> Usually it's really helpful if you can find the commit id which broke
> it. 'git bisect' is a great tool to do that and this seems to be a nice
> tutorial how to use it:
>=20
> http://webchick.net/node/99
>=20
> Instead of commit ids you can use release tags like v4.6 and v4.7 to
> make it easier to start the bisect. Just make sure that v4.7 is really
> broken and v4.6 works before you start the bisection.
Hi Kalle,
I tried to understand the whole procedure related to git and git bisect, an=
d=20
this is the first time I try it, so I can have done some mistake. In the gi=
t=20
log you'll find the commit that could be guilty for the behaviour I reporte=
d=20
yesterday. Anyhow, the resulting commit doesn't make any sense to me. If yo=
u=20
have any request, please send an email in cc to me, because I want to=20
unsuscribe this mailing list since it's too high volume for me. Best regards
Valerio
git bisect log
git bisect start
# good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
# bad: [523d939ef98fd712632d93a5a2b588e477a7565e] Linux 4.7
git bisect bad 523d939ef98fd712632d93a5a2b588e477a7565e
# good: [0694f0c9e20c47063e4237e5f6649ae5ce5a369a] radix tree test suite:=20
remove dependencies on height
git bisect good 0694f0c9e20c47063e4237e5f6649ae5ce5a369a
# good: [e4f7bdc2ec0d0dcc27f7d70db27a620dfdc1f697] Merge branch 'for-4.7-za=
c'=20
of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
git bisect good e4f7bdc2ec0d0dcc27f7d70db27a620dfdc1f697
# bad: [049ec1b5a76d34a6980cccdb7c0baeb4eed7a993] Merge tag 'drm-fixes-for-
v4.7-rc2' of git://people.freedesktop.org/~airlied/linux
git bisect bad 049ec1b5a76d34a6980cccdb7c0baeb4eed7a993
# good: [a10c38a4f385f5d7c173a263ff6bb2d36021b3bb] Merge branch 'for-linus'=
of=20
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
git bisect good a10c38a4f385f5d7c173a263ff6bb2d36021b3bb
# bad: [9ba55cf7cfbfd12a7e914d0d55b7581e896b3f0d] Merge branch 'for-next' o=
f=20
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
git bisect bad 9ba55cf7cfbfd12a7e914d0d55b7581e896b3f0d
# bad: [c61b49c79e1c1d4bc0c2fdc053ef56e65759b5fd] Merge tag 'drm-fixes-v4.7-
rc1' of git://people.freedesktop.org/~airlied/linux
git bisect bad c61b49c79e1c1d4bc0c2fdc053ef56e65759b5fd
# good: [dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6] Merge branch 'misc' of=20
git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
git bisect good dc03c0f9d12d85286d5e3623aa96d5c2a271b8e6
# good: [e28e909c36bb5d6319953822d84df00fce7cbd18] Merge tag 'for-linus' of=
=20
git://git.kernel.org/pub/scm/virt/kvm/kvm
git bisect good e28e909c36bb5d6319953822d84df00fce7cbd18
# good: [79b3c7164c18e2fe9e69b0dcc0d45bab7ae3c968] Merge branch 'drm-next-4=
=2E7'=20
of git://people.freedesktop.org/~agd5f/linux into drm-next
git bisect good 79b3c7164c18e2fe9e69b0dcc0d45bab7ae3c968
# bad: [1e8143db755f745a9842984de5e8b423f583aea2] Merge tag 'platform-drive=
rs-
x86-v4.7-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-=
x86
git bisect bad 1e8143db755f745a9842984de5e8b423f583aea2
# good: [afcedebc6a094224973534f43b396bbbf33fe44e] thinkpad_acpi: save=20
kbdlight state on suspend and restore it on resume
git bisect good afcedebc6a094224973534f43b396bbbf33fe44e
# good: [2aac630429d986a43ac59525a4cff47a624dc58e] iommu/vt-d: change intel-
iommu to use IOVA frame numbers
git bisect good 2aac630429d986a43ac59525a4cff47a624dc58e
# bad: [2566278551d3db875bc3bbfc41b42f2e80392108] Merge git://
git.infradead.org/intel-iommu
git bisect bad 2566278551d3db875bc3bbfc41b42f2e80392108
^ permalink raw reply
* Re: rtl8xxxu: fix spelling mistake "firmare" -> "firmware"
From: Kalle Valo @ 2016-09-08 12:28 UTC (permalink / raw)
To: Colin Ian King; +Cc: Jes Sorensen, linux-wireless, netdev, linux-kernel
In-Reply-To: <20160903164354.13331-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Trivial fix to spelling mistakes in dev_dbg message.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
I assume Jes will take this.
--
Sent by pwcli
https://patchwork.kernel.org/patch/9312169/
^ permalink raw reply
* Re: [PATCH v4 2/4] wcn36xx: Transition driver to SMD client
From: Kalle Valo @ 2016-09-08 12:16 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Eugene Krasnikov, wcn36xx, linux-wireless, netdev, linux-kernel,
linux-arm-msm, Andy Gross
In-Reply-To: <1473200312-22438-2-git-send-email-bjorn.andersson@linaro.org>
Bjorn Andersson <bjorn.andersson@linaro.org> writes:
> The wcn36xx wifi driver follows the life cycle of the WLAN_CTRL SMD
> channel, as such it should be a SMD client. This patch makes this
> transition, now that we have the necessary frameworks available.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>
> Changes since v3:
> - Made msg_header const in wcn36xx_smd_rsp_process()
>
> Changes since v2:
> - Correct the call to the new ieee80211_scan_completed()
>
> drivers/net/wireless/ath/wcn36xx/dxe.c | 16 +++---
> drivers/net/wireless/ath/wcn36xx/main.c | 79 ++++++++++++++++++++----------
> drivers/net/wireless/ath/wcn36xx/smd.c | 31 +++++-------
> drivers/net/wireless/ath/wcn36xx/smd.h | 5 ++
> drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 21 +++-----
> 5 files changed, 86 insertions(+), 66 deletions(-)
This doesn't compile for me:
CC [M] drivers/net/wireless/ath/wcn36xx/main.o
CC [M] drivers/net/wireless/ath/wcn36xx/dxe.o
CC [M] drivers/net/wireless/ath/wcn36xx/txrx.o
CC [M] drivers/net/wireless/ath/wcn36xx/smd.o
CC [M] drivers/net/wireless/ath/wcn36xx/pmc.o
CC [M] drivers/net/wireless/ath/wcn36xx/debug.o
LD [M] drivers/net/wireless/ath/wcn36xx/wcn36xx.o
drivers/net/wireless/ath/wcn36xx/smd.o: In function `qcom_smd_get_drvdata':
/home/kvalo/ath10k/src/ath/./include/linux/soc/qcom/smd.h:87: multiple definition of `qcom_smd_get_drvdata'
drivers/net/wireless/ath/wcn36xx/main.o:/home/kvalo/ath10k/src/ath/./include/linux/soc/qcom/smd.h:87: first defined here
drivers/net/wireless/ath/wcn36xx/smd.o: In function `qcom_smd_set_drvdata':
/home/kvalo/ath10k/src/ath/./include/linux/soc/qcom/smd.h:94: multiple definition of `qcom_smd_set_drvdata'
drivers/net/wireless/ath/wcn36xx/main.o:/home/kvalo/ath10k/src/ath/./include/linux/soc/qcom/smd.h:94: first defined here
make[5]: *** [drivers/net/wireless/ath/wcn36xx/wcn36xx.o] Error 1
I fixed it with the diff below. Please let me know if it looks ok to
you, the patch is not applied yet so it's easy to make changes. The full
commit in my pending branch:
https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=dba68ea7a404a9959d0ab44bc13c844187db6d6a
--- a/include/linux/soc/qcom/smd.h
+++ b/include/linux/soc/qcom/smd.h
@@ -83,14 +83,14 @@ qcom_smd_open_channel(struct qcom_smd_channel *channel,
return NULL;
}
-void *qcom_smd_get_drvdata(struct qcom_smd_channel *channel)
+static inline void *qcom_smd_get_drvdata(struct qcom_smd_channel *channel)
{
/* This shouldn't be possible */
WARN_ON(1);
return NULL;
}
-void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data)
+static inline void qcom_smd_set_drvdata(struct qcom_smd_channel *channel, void *data)
{
/* This shouldn't be possible */
WARN_ON(1);
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 1/2] ath9k: use ieee80211_tx_status_noskb where possible
From: Felix Fietkau @ 2016-09-08 11:43 UTC (permalink / raw)
To: Kalle Valo, Zefir Kurtisi; +Cc: linux-wireless
In-Reply-To: <87y432sjoj.fsf@kamboji.qca.qualcomm.com>
On 2016-09-08 13:41, Kalle Valo wrote:
> Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:
>
>> On 08/11/2016 09:27 PM, Felix Fietkau wrote:
>>> On 2016-08-11 18:05, Zefir Kurtisi wrote:
>>>> On 08/04/2016 11:49 PM, Felix Fietkau wrote:
>>>>> It removes the need for undoing the padding changes to skb->data and it
>>>>> improves performance by eliminating one tx status lookup per MPDU in the
>>>>> status path. It is also useful for preparing a follow-up fix to better
>>>>> handle powersave filtering.
>>>>>
>>>>
>>>> For me, this one introduces a regression to the statistics, e.g.
>>>> 'dot11TransmittedFragmentCount' is now accounted differently since it is not
>>>> updated from within ieee80211_tx_status_noskb().
>>> Is this important? I guess it would be possible to make this more
>>> accurate by extending the API, but I wonder if that's worth doing just
>>> for these debugfs counters.
>>>
>> If you want to support the IEEE802dot11.MIB (dot11mac.dot11CountersTable), they
>> are important. Not sure though if it is used by others besides us.
>>
>> I think the real issue here is that those counters are regarded as internal debug
>> values (as the comments or e.g. commit c206ca6709 state) instead of general
>> purpose statistics that is exposed to SNMP. As such, they should be configurable
>> as a feature independent of debug settings in mac80211.
>>
>>
>> Aside from that consideration, this patch (with the follow up ones) increased peak
>> performance noticeably (we measure some 5%+ higher peak throughput), which for
>> sure is worth dropping the counters for most.
>>
>> I am fine handling this internally. A note in the commit message would be helpful
>> that states that counters dot11TransmittedFragmentCount, dot11FrameDuplicateCount,
>> dot11ReceivedFragmentCount, and dot11MulticastReceivedFrameCount become invalid.
>
> A good idea, I updated the commit log to mention that. Does that look
> ok?
>
> Author: Felix Fietkau <nbd@nbd.name>
> Date: Fri Sep 2 19:46:12 2016 +0300
>
> ath9k: use ieee80211_tx_status_noskb where possible
>
> It removes the need for undoing the padding changes to skb->data and it
> improves performance by eliminating one tx status lookup per MPDU in the
> status path. It is also useful for preparing a follow-up fix to better
> handle powersave filtering.
>
> A side effect is that these counters, available via debugfs, become now invalid:
>
> * dot11TransmittedFragmentCount
> * dot11FrameDuplicateCount,
> * dot11ReceivedFragmentCount
> * dot11MulticastReceivedFrameCount
>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Looks good to me.
- Felix
^ permalink raw reply
* Re: [PATCH 1/2] ath9k: use ieee80211_tx_status_noskb where possible
From: Kalle Valo @ 2016-09-08 11:41 UTC (permalink / raw)
To: Zefir Kurtisi; +Cc: Felix Fietkau, linux-wireless
In-Reply-To: <236fc08a-9474-0917-47f0-756e9136e3b5@neratec.com>
Zefir Kurtisi <zefir.kurtisi@neratec.com> writes:
> On 08/11/2016 09:27 PM, Felix Fietkau wrote:
>> On 2016-08-11 18:05, Zefir Kurtisi wrote:
>>> On 08/04/2016 11:49 PM, Felix Fietkau wrote:
>>>> It removes the need for undoing the padding changes to skb->data and it
>>>> improves performance by eliminating one tx status lookup per MPDU in the
>>>> status path. It is also useful for preparing a follow-up fix to better
>>>> handle powersave filtering.
>>>>
>>>
>>> For me, this one introduces a regression to the statistics, e.g.
>>> 'dot11TransmittedFragmentCount' is now accounted differently since it is not
>>> updated from within ieee80211_tx_status_noskb().
>> Is this important? I guess it would be possible to make this more
>> accurate by extending the API, but I wonder if that's worth doing just
>> for these debugfs counters.
>>
> If you want to support the IEEE802dot11.MIB (dot11mac.dot11CountersTable), they
> are important. Not sure though if it is used by others besides us.
>
> I think the real issue here is that those counters are regarded as internal debug
> values (as the comments or e.g. commit c206ca6709 state) instead of general
> purpose statistics that is exposed to SNMP. As such, they should be configurable
> as a feature independent of debug settings in mac80211.
>
>
> Aside from that consideration, this patch (with the follow up ones) increased peak
> performance noticeably (we measure some 5%+ higher peak throughput), which for
> sure is worth dropping the counters for most.
>
> I am fine handling this internally. A note in the commit message would be helpful
> that states that counters dot11TransmittedFragmentCount, dot11FrameDuplicateCount,
> dot11ReceivedFragmentCount, and dot11MulticastReceivedFrameCount become invalid.
A good idea, I updated the commit log to mention that. Does that look
ok?
Author: Felix Fietkau <nbd@nbd.name>
Date: Fri Sep 2 19:46:12 2016 +0300
ath9k: use ieee80211_tx_status_noskb where possible
It removes the need for undoing the padding changes to skb->data and it
improves performance by eliminating one tx status lookup per MPDU in the
status path. It is also useful for preparing a follow-up fix to better
handle powersave filtering.
A side effect is that these counters, available via debugfs, become now invalid:
* dot11TransmittedFragmentCount
* dot11FrameDuplicateCount,
* dot11ReceivedFragmentCount
* dot11MulticastReceivedFrameCount
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Patchwork-Id: 9264385
[kvalo@qca.qualcomm.com: add a note about counters, thanks to Zefir Kurtisi]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
--
Kalle Valo
^ permalink raw reply
* pull-request: wireless-drivers 2016-09-08
From: Kalle Valo @ 2016-09-08 11:31 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
Hi Dave,
few important, but as can be seen from the diffstat, really small fixes
for 4.8. Please let me know if you have any problems.
Kalle
The following changes since commit bb87f02b7e4ccdb614a83cbf840524de81e9b321:
Merge ath-current from ath.git (2016-08-29 21:39:04 +0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2016-09-08
for you to fetch changes up to a0714125d11bcf21599b08b25fdaf384c0db6712:
Merge ath-current from ath.git (2016-09-07 20:16:37 +0300)
----------------------------------------------------------------
wireless-drivers fixes for 4.8
iwlwifi
* fix P2P dump trigger
* prevent a potential null dereference in iwlmvm
* prevent an uninitialized value from being returned in iwlmvm
* advertise support for channel width change in AP mode
ath10k
* fix racy rx status retrieval from htt context
* QCA9887 support is not experimental anymore, remove the warning message
ath9k
* fix regression with led GPIOs
* fix AR5416 GPIO access warning
brcmfmac
* avoid potential stack overflow in brcmf_cfg80211_start_ap()
----------------------------------------------------------------
Arend Van Spriel (1):
brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()
Ashok Raj Nagarajan (1):
ath10k: fix get rx_status from htt context
Emmanuel Grumbach (2):
iwlwifi: mvm: consider P2p device type for firmware dump triggers
iwlwifi: mvm: don't use ret when not initialised
Giedrius Statkevičius (1):
ath9k: bring back direction setting in ath9k_{start_stop}
Kalle Valo (2):
Merge tag 'iwlwifi-for-kalle-2016-08-29' of git://git.kernel.org/.../iwlwifi/iwlwifi-fixes
Merge ath-current from ath.git
Miaoqing Pan (1):
ath9k: fix AR5416 access GPIO warning
Mohammed Shafi Shajakhan (1):
ath10k: Remove driver log suggesting QCA9887 support is experimental
Peer, Ilan (1):
iwlwifi: mvm: Advertise support for AP channel width change
Sharon Dvir (1):
iwlwifi: mvm: check if vif is NULL before using it
drivers/net/wireless/ath/ath10k/htt_rx.c | 10 +++++-----
drivers/net/wireless/ath/ath10k/pci.c | 1 -
drivers/net/wireless/ath/ath9k/hw.c | 4 ++--
drivers/net/wireless/ath/ath9k/main.c | 9 +++++++--
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c | 3 ++-
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.h | 3 ++-
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++
9 files changed, 22 insertions(+), 13 deletions(-)
^ permalink raw reply
* Re: [PATCH v3 1/3] Documentation: dt: net: add mt76 wireless device binding
From: Kalle Valo @ 2016-09-08 10:54 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, devicetree
In-Reply-To: <20160905095128.80560-2-nbd@nbd.name>
Felix Fietkau <nbd@nbd.name> writes:
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> .../bindings/net/wireless/mediatek,mt76.txt | 26 ++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>
> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> new file mode 100644
> index 0000000..d51c35f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
> @@ -0,0 +1,26 @@
> +* MediaTek mt76xx devices
> +
> +This node provides properties for configuring the MediaTek mt76xx wireless
> +device. The node is expected to be specified as a child node of the PCI
> +controller to which the wireless chip is connected.
> +
> +Optional properties:
> +
> +- mac-address: See ethernet.txt in the parent directory
> +- local-mac-address: See ethernet.txt in the parent directory
> +- mediatek,2ghz: Override the 2.4 GHz band capability from EEPROM
> +- mediatek,5ghz: Override the 5 GHz band capability from EEPROM
> +- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
> +
> +&pcie {
> + status = "okay";
> +
> + pcie0 {
> + mt76@0,0 {
> + reg = <0x0000 0 0 0 0>;
> + device_type = "pci";
> + mediatek,mtd-eeprom = <&factory 0x8000>;
> + mediatek,2ghz = <0>;
> + };
> + };
> +};
I need an ack from device tree maintainers, CCing the devicetree list.
Do we need to resend or this ok?
Patchwork link:
https://patchwork.kernel.org/patch/9313309/
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] rsi: code clean-up
From: Kalle Valo @ 2016-09-08 10:46 UTC (permalink / raw)
To: Arend Van Spriel
Cc: Prameela Rani Garnepudi, linux-wireless, johannes.berg, hofrat,
xypron.glpk, Prameela Rani Garnepudi
In-Reply-To: <9f56e811-e415-7a2e-605a-dce0cf6a1cf1@broadcom.com>
Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
> On 8-9-2016 7:36, Prameela Rani Garnepudi wrote:
>> From: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
>
> Seems like you missed the essential training on main-line driver
> development :-p
>
> Typically you should split this up in conceptually separate patches so
> it is easier for people to review. A large patch changing things all
> over the place solving different things is taking a lot more time to review.
>
> So go work on branch, make a commit for each issue you want to address,
> and when ready do (using 6 commits as example):
>
> $ git format-patch -s -M --cover-letter -6
>
> The '--cover-letter' results in 0000-...patch file in which you can
> summarize the changes in bullet list so Kalle can reuse that moving the
> patches upstream to networking subsystem.
>
> When done use git to send the patches:
>
> $ git send-email --to='Kalle Valo <kvalo@codeaurora.org>'
> --cc=linux-wireless@vger.kernel.org *.patch
And write a commit log for each patch. In minimum the commit log should
answer to the question "Why?".
A good way to learn how the this all works is to see how others do it.
For example, you can see all ath9k commits like this:
gitk drivers/net/wireless/ath/ath9k/
or iwlwifi:
gitk drivers/net/wireless/intel/iwlwifi/
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] rsi: code clean-up
From: Arend Van Spriel @ 2016-09-08 9:34 UTC (permalink / raw)
To: Prameela Rani Garnepudi, linux-wireless, kvalo, johannes.berg,
hofrat, xypron.glpk
Cc: Prameela Rani Garnepudi
In-Reply-To: <1473313017-4074-1-git-send-email-prameela.j04cs@gmail.com>
On 8-9-2016 7:36, Prameela Rani Garnepudi wrote:
> From: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
Seems like you missed the essential training on main-line driver
development :-p
Typically you should split this up in conceptually separate patches so
it is easier for people to review. A large patch changing things all
over the place solving different things is taking a lot more time to review.
So go work on branch, make a commit for each issue you want to address,
and when ready do (using 6 commits as example):
$ git format-patch -s -M --cover-letter -6
The '--cover-letter' results in 0000-...patch file in which you can
summarize the changes in bullet list so Kalle can reuse that moving the
patches upstream to networking subsystem.
When done use git to send the patches:
$ git send-email --to='Kalle Valo <kvalo@codeaurora.org>'
--cc=linux-wireless@vger.kernel.org *.patch
Regards,
> Signed-off-by: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
> ---
> drivers/net/wireless/rsi/rsi_91x_core.c | 18 ++--
> drivers/net/wireless/rsi/rsi_91x_debugfs.c | 13 +--
> drivers/net/wireless/rsi/rsi_91x_mac80211.c | 81 +++++++++------
> drivers/net/wireless/rsi/rsi_91x_main.c | 16 ++-
> drivers/net/wireless/rsi/rsi_91x_mgmt.c | 155 +++++++++++-----------------
> drivers/net/wireless/rsi/rsi_91x_sdio.c | 14 +--
> drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 11 +-
> drivers/net/wireless/rsi/rsi_91x_usb.c | 34 ++++--
> drivers/net/wireless/rsi/rsi_common.h | 2 +-
> drivers/net/wireless/rsi/rsi_debugfs.h | 3 +-
> drivers/net/wireless/rsi/rsi_main.h | 36 ++++---
> drivers/net/wireless/rsi/rsi_mgmt.h | 54 +++++-----
> drivers/net/wireless/rsi/rsi_sdio.h | 18 ++--
> 13 files changed, 228 insertions(+), 227 deletions(-)
>
> diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c
> index f3d3995..c6db8a9 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_core.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_core.c
> @@ -134,7 +134,7 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
> bool recontend_queue = false;
> u32 q_len = 0;
> u8 q_num = INVALID_QUEUE;
> - u8 ii = 0;
> + u8 ii;
>
> if (skb_queue_len(&common->tx_queue[MGMT_SOFT_Q])) {
> if (!common->mgmt_q_block)
> @@ -142,8 +142,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
> return q_num;
> }
>
> - if (common->hw_data_qs_blocked)
> + if (common->hw_data_qs_blocked) {
> + rsi_dbg(INFO_ZONE, "%s: data queue blocked\n", __func__);
> return q_num;
> + }
>
> if (common->pkt_cnt != 0) {
> --common->pkt_cnt;
> @@ -210,6 +212,7 @@ static void rsi_core_queue_pkt(struct rsi_common *common,
> struct sk_buff *skb)
> {
> u8 q_num = skb->priority;
> +
> if (q_num >= NUM_SOFT_QUEUES) {
> rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
> __func__, q_num);
> @@ -285,7 +288,7 @@ void rsi_core_qos_processor(struct rsi_common *common)
> }
>
> skb = rsi_core_dequeue_pkt(common, q_num);
> - if (skb == NULL) {
> + if (!skb) {
> rsi_dbg(ERR_ZONE, "skb null\n");
> mutex_unlock(&common->tx_rxlock);
> break;
> @@ -331,15 +334,16 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
> __func__);
> goto xmit_fail;
> }
> - info = IEEE80211_SKB_CB(skb);
> - tx_params = (struct skb_info *)info->driver_data;
> - tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
>
> if (common->fsm_state != FSM_MAC_INIT_DONE) {
> rsi_dbg(ERR_ZONE, "%s: FSM state not open\n", __func__);
> goto xmit_fail;
> }
>
> + info = IEEE80211_SKB_CB(skb);
> + tx_params = (struct skb_info *)info->driver_data;
> + tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
> +
> if ((ieee80211_is_mgmt(tmp_hdr->frame_control)) ||
> (ieee80211_is_ctl(tmp_hdr->frame_control)) ||
> (ieee80211_is_qos_nullfunc(tmp_hdr->frame_control))) {
> @@ -360,7 +364,7 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
>
> if ((q_num != MGMT_SOFT_Q) &&
> ((skb_queue_len(&common->tx_queue[q_num]) + 1) >=
> - DATA_QUEUE_WATER_MARK)) {
> + DATA_QUEUE_WATER_MARK)) {
> rsi_dbg(ERR_ZONE, "%s: sw queue full\n", __func__);
> if (!ieee80211_queue_stopped(adapter->hw, WME_AC(q_num)))
> ieee80211_stop_queue(adapter->hw, WME_AC(q_num));
> diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
> index 828a042..5ec7bce 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
> @@ -59,7 +59,7 @@ static int rsi_sdio_stats_read(struct seq_file *seq, void *data)
> }
>
> /**
> - * rsi_sdio_stats_open() - This funtion calls single open function of seq_file
> + * rsi_sdio_stats_open() - This function calls single open function of seq_file
> * to open file and read contents from it.
> * @inode: Pointer to the inode structure.
> * @file: Pointer to the file structure.
> @@ -100,7 +100,7 @@ static int rsi_version_read(struct seq_file *seq, void *data)
> }
>
> /**
> - * rsi_version_open() - This funtion calls single open function of seq_file to
> + * rsi_version_open() - This function calls single open function of seq_file to
> * open file and read contents from it.
Two functions with the same generic description. Just mention what info
it provides.
> * @inode: Pointer to the inode structure.
> * @file: Pointer to the file structure.
> @@ -108,7 +108,7 @@ static int rsi_version_read(struct seq_file *seq, void *data)
> * Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
> */
> static int rsi_version_open(struct inode *inode,
> - struct file *file)
> + struct file *file)
The indentation should be aligned to the opening bracket.
> {
> return single_open(file, rsi_version_read, inode->i_private);
> }
> @@ -180,7 +180,7 @@ static int rsi_stats_read(struct seq_file *seq, void *data)
> }
>
> /**
> - * rsi_stats_open() - This funtion calls single open function of seq_file to
> + * rsi_stats_open() - This function calls single open function of seq_file to
> * open file and read contents from it.
too generic.
> * @inode: Pointer to the inode structure.
> * @file: Pointer to the file structure.
> @@ -194,7 +194,8 @@ static int rsi_stats_open(struct inode *inode,
> }
>
> /**
> - * rsi_debug_zone_read() - This function display the currently enabled debug zones.
> + * rsi_debug_zone_read() - This function display the currently
> + * enabled debug zones.
> * @seq: Pointer to the sequence file structure.
> * @data: Pointer to the data.
> *
> @@ -209,7 +210,7 @@ static int rsi_debug_zone_read(struct seq_file *seq, void *data)
> }
>
> /**
> - * rsi_debug_read() - This funtion calls single open function of seq_file to
> + * rsi_debug_read() - This function calls single open function of seq_file to
> * open file and read contents from it.
too generic.
> * @inode: Pointer to the inode structure.
> * @file: Pointer to the file structure.
> diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> index dbb2389..9c6fa61 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
> @@ -194,6 +194,7 @@ static void rsi_register_rates_channels(struct rsi_hw *adapter, int band)
> void rsi_mac80211_detach(struct rsi_hw *adapter)
> {
> struct ieee80211_hw *hw = adapter->hw;
> + int i;
>
> if (hw) {
> ieee80211_stop_queues(hw);
> @@ -201,7 +202,17 @@ void rsi_mac80211_detach(struct rsi_hw *adapter)
> ieee80211_free_hw(hw);
> }
>
> + for (i = 0; i < 2; i++) {
Do not use hardcode value, but ARRAY_SIZE(adapter->sbands).
> + struct ieee80211_supported_band *sbands = &adapter->sbands[i];
> +
> + if (!sbands->channels)
> + kfree(sbands->channels);
This does not seem right. Why do a kfree() is sbands->channels is null?
> + }
> +
> +#ifdef CONFIG_RSI_DEBUGFS
> rsi_remove_dbgfs(adapter);
> + kfree(adapter->dfsentry);
> +#endif
> }
> EXPORT_SYMBOL_GPL(rsi_mac80211_detach);
>
> @@ -429,9 +440,11 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
> u16 rsi_get_connected_channel(struct rsi_hw *adapter)
> {
> struct ieee80211_vif *vif = adapter->vifs[0];
> +
> if (vif) {
> struct ieee80211_bss_conf *bss = &vif->bss_conf;
> struct ieee80211_channel *channel = bss->chandef.chan;
> +
> return channel->hw_value;
> }
>
> @@ -667,15 +680,14 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
> struct ieee80211_vif *vif,
> struct ieee80211_ampdu_params *params)
> {
> - int status = -EOPNOTSUPP;
> + int status = 1;
> struct rsi_hw *adapter = hw->priv;
> struct rsi_common *common = adapter->priv;
> - u16 seq_no = 0;
> + u16 seq_no = params->ssn;
> u8 ii = 0;
> struct ieee80211_sta *sta = params->sta;
> enum ieee80211_ampdu_mlme_action action = params->action;
> u16 tid = params->tid;
> - u16 *ssn = ¶ms->ssn;
> u8 buf_size = params->buf_size;
>
> for (ii = 0; ii < RSI_MAX_VIFS; ii++) {
> @@ -684,28 +696,30 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
> }
>
> mutex_lock(&common->mutex);
> - rsi_dbg(INFO_ZONE, "%s: AMPDU action %d called\n", __func__, action);
> - if (ssn != NULL)
> - seq_no = *ssn;
>
> switch (action) {
> case IEEE80211_AMPDU_RX_START:
> - status = rsi_send_aggregation_params_frame(common,
> - tid,
> - seq_no,
> - buf_size,
> - STA_RX_ADDBA_DONE);
> + rsi_dbg(INFO_ZONE, "AMPDU action RX_START (%d)\n", action);
> + status = rsi_send_aggr_params_frame(common,
> + tid,
> + seq_no,
> + buf_size,
> + STA_RX_ADDBA_DONE);
> break;
>
> case IEEE80211_AMPDU_RX_STOP:
> - status = rsi_send_aggregation_params_frame(common,
> - tid,
> - 0,
> - buf_size,
> - STA_RX_DELBA);
> + rsi_dbg(INFO_ZONE,
> + "AMPDU action RX_STOP (%d) called\n", action);
> + status = rsi_send_aggr_params_frame(common,
> + tid,
> + 0,
> + buf_size,
> + STA_RX_DELBA);
> break;
>
> case IEEE80211_AMPDU_TX_START:
> + rsi_dbg(INFO_ZONE,
> + "AMPDU action TX_START (%d) called\n", action);
> common->vif_info[ii].seq_start = seq_no;
> ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
> status = 0;
> @@ -714,22 +728,27 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
> case IEEE80211_AMPDU_TX_STOP_CONT:
> case IEEE80211_AMPDU_TX_STOP_FLUSH:
> case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
> - status = rsi_send_aggregation_params_frame(common,
> - tid,
> - seq_no,
> - buf_size,
> - STA_TX_DELBA);
> + rsi_dbg(INFO_ZONE,
> + "AMPDU action TX_STOP_CONT / TX_STOP_FLUSH /"
> + " TX_STOP_FLUSH_CONT (%d) called\n", action);
> + status = rsi_send_aggr_params_frame(common,
> + tid,
> + seq_no,
> + buf_size,
> + STA_TX_DELBA);
> if (!status)
> ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
> break;
>
> case IEEE80211_AMPDU_TX_OPERATIONAL:
> - status = rsi_send_aggregation_params_frame(common,
> - tid,
> - common->vif_info[ii]
> - .seq_start,
> - buf_size,
> - STA_TX_ADDBA_DONE);
> + rsi_dbg(INFO_ZONE,
> + "AMPDU action TX_OPERATIONAL(%d) called\n",
> + action);
> + status = rsi_send_aggr_params_frame(common,
> + tid,
> + common->vif_info[ii].seq_start,
> + buf_size,
> + STA_TX_ADDBA_DONE);
> break;
>
> default:
> @@ -819,8 +838,6 @@ static void rsi_perform_cqm(struct rsi_common *common,
> common->cqm_info.last_cqm_event_rssi = rssi;
> rsi_dbg(INFO_ZONE, "CQM: Notifying event: %d\n", event);
> ieee80211_cqm_rssi_notify(adapter->vifs[0], event, GFP_KERNEL);
> -
> - return;
> }
>
> /**
> @@ -875,16 +892,14 @@ static void rsi_fill_rx_status(struct ieee80211_hw *hw,
> }
>
> /* CQM only for connected AP beacons, the RSSI is a weighted avg */
> - if (bss->assoc && !(memcmp(bss->bssid, hdr->addr2, ETH_ALEN))) {
> + if (bss->assoc && ether_addr_equal(bss->bssid, hdr->addr2)) {
> if (ieee80211_is_beacon(hdr->frame_control))
> rsi_perform_cqm(common, hdr->addr2, rxs->signal);
> }
> -
> - return;
> }
>
> /**
> - * rsi_indicate_pkt_to_os() - This function sends recieved packet to mac80211.
> + * rsi_indicate_pkt_to_os() - This function sends received packet to mac80211.
> * @common: Pointer to the driver private structure.
> * @skb: Pointer to the socket buffer structure.
> *
> diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c
> index 8810862..f59a66a 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_main.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_main.c
> @@ -86,7 +86,7 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
>
> pkt_len -= extended_desc;
> skb = dev_alloc_skb(pkt_len + FRAME_DESC_SZ);
> - if (skb == NULL)
> + if (!skb)
> return NULL;
>
> payload_offset = (extended_desc + FRAME_DESC_SZ);
> @@ -111,11 +111,10 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
> int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
> {
> u8 *frame_desc = NULL, extended_desc = 0;
> - u32 index, length = 0, queueno = 0;
> + u32 index = 0, length = 0, queueno = 0;
> u16 actual_length = 0, offset;
> struct sk_buff *skb = NULL;
>
> - index = 0;
> do {
> frame_desc = &common->rx_data_pkt[index];
> actual_length = *(u16 *)&frame_desc[0];
> @@ -131,7 +130,7 @@ int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
> (frame_desc + offset),
> length,
> extended_desc);
> - if (skb == NULL)
> + if (!skb)
> goto fail;
>
> rsi_indicate_pkt_to_os(common, skb);
> @@ -198,15 +197,14 @@ struct rsi_hw *rsi_91x_init(void)
> return NULL;
>
> adapter->priv = kzalloc(sizeof(*common), GFP_KERNEL);
> - if (adapter->priv == NULL) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of memory\n",
> + if (!adapter->priv) {
> + rsi_dbg(ERR_ZONE, "%s: Failed in allocation of priv\n",
> __func__);
> kfree(adapter);
> return NULL;
> - } else {
> - common = adapter->priv;
> - common->priv = adapter;
> }
> + common = adapter->priv;
> + common->priv = adapter;
>
> for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
> skb_queue_head_init(&common->tx_queue[ii]);
> diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
> index 35c14cc..db96bd7 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
> @@ -255,9 +255,9 @@ static int rsi_send_internal_mgmt_frame(struct rsi_common *common,
> {
> struct skb_info *tx_params;
>
> - if (skb == NULL) {
> + if (!skb) {
> rsi_dbg(ERR_ZONE, "%s: Unable to allocate skb\n", __func__);
> - return -ENOMEM;
> + return -EINVAL;
The debug message should be changed as well as no allocation attempt is
made here. Can skb ever be null or would it be an error during development?
> }
> tx_params = (struct skb_info *)&IEEE80211_SKB_CB(skb)->driver_data;
> tx_params->flags |= INTERNAL_MGMT_PKT;
> @@ -290,12 +290,8 @@ static int rsi_load_radio_caps(struct rsi_common *common)
> rsi_dbg(INFO_ZONE, "%s: Sending rate symbol req frame\n", __func__);
>
> skb = dev_alloc_skb(sizeof(struct rsi_radio_caps));
> -
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, sizeof(struct rsi_radio_caps));
> radio_caps = (struct rsi_radio_caps *)skb->data;
> @@ -375,8 +371,8 @@ static int rsi_load_radio_caps(struct rsi_common *common)
> * rsi_mgmt_pkt_to_core() - This function is the entry point for Mgmt module.
> * @common: Pointer to the driver private structure.
> * @msg: Pointer to received packet.
> - * @msg_len: Length of the recieved packet.
> - * @type: Type of recieved packet.
> + * @msg_len: Length of the received packet.
> + * @type: Type of received packet.
> *
> * Return: 0 on success, -1 on failure.
> */
> @@ -406,11 +402,8 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
> }
>
> skb = dev_alloc_skb(msg_len);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed to allocate skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> buffer = skb_put(skb, msg_len);
>
> @@ -425,9 +418,8 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
> rx_params->rssi = rsi_get_rssi(msg);
> rx_params->channel = rsi_get_channel(msg);
> rsi_indicate_pkt_to_os(common, skb);
> - } else {
> + } else
> rsi_dbg(MGMT_TX_ZONE, "%s: Internal Packet\n", __func__);
> - }
For readability this is an exception to the rule and so here it is
allowed to have curly braces around single else statement.
>
> return 0;
> }
> @@ -459,12 +451,8 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending sta notify frame\n", __func__);
>
> skb = dev_alloc_skb(sizeof(struct rsi_peer_notify));
> -
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, sizeof(struct rsi_peer_notify));
> peer_notify = (struct rsi_peer_notify *)skb->data;
> @@ -505,7 +493,7 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
> }
>
> /**
> - * rsi_send_aggregation_params_frame() - This function sends the ampdu
> + * rsi_send_aggr_params_frame() - This function sends the ampdu
> * indication frame to firmware.
> * @common: Pointer to the driver private structure.
> * @tid: traffic identifier.
> @@ -515,28 +503,26 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
> *
> * Return: 0 on success, corresponding negative error code on failure.
> */
> -int rsi_send_aggregation_params_frame(struct rsi_common *common,
> - u16 tid,
> - u16 ssn,
> - u8 buf_size,
> - u8 event)
> +int rsi_send_aggr_params_frame(struct rsi_common *common,
> + u16 tid,
> + u16 ssn,
> + u8 buf_size,
> + u8 event)
align with opening brace.
> {
> struct sk_buff *skb = NULL;
> struct rsi_mac_frame *mgmt_frame;
> u8 peer_id = 0;
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> -
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
>
> - rsi_dbg(MGMT_TX_ZONE, "%s: Sending AMPDU indication frame\n", __func__);
> + rsi_dbg(MGMT_TX_ZONE,
> + "%s: Sending AMPDU indication frame\n",
> + __func__);
>
> mgmt_frame->desc_word[0] = cpu_to_le16(RSI_WIFI_MGMT_Q << 12);
> mgmt_frame->desc_word[1] = cpu_to_le16(AMPDU_IND);
> @@ -545,7 +531,9 @@ int rsi_send_aggregation_params_frame(struct rsi_common *common,
> mgmt_frame->desc_word[4] = cpu_to_le16(ssn);
> mgmt_frame->desc_word[5] = cpu_to_le16(buf_size);
> mgmt_frame->desc_word[7] =
> - cpu_to_le16((tid | (START_AMPDU_AGGR << 4) | (peer_id << 8)));
> + cpu_to_le16((tid |
> + (START_AMPDU_AGGR << 4) |
> + (peer_id << 8)));
need extra space for indent.
> } else if (event == STA_RX_ADDBA_DONE) {
> mgmt_frame->desc_word[4] = cpu_to_le16(ssn);
> mgmt_frame->desc_word[7] = cpu_to_le16(tid |
> @@ -583,11 +571,8 @@ static int rsi_program_bb_rf(struct rsi_common *common)
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending program BB/RF frame\n", __func__);
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
> @@ -605,6 +590,7 @@ static int rsi_program_bb_rf(struct rsi_common *common)
> common->bb_rf_prog_count = 1;
> mgmt_frame->desc_word[7] |= cpu_to_le16(PUT_BBP_RESET |
> BBP_REG_WRITE | (RSI_RF_TYPE << 4));
> +
> skb_put(skb, FRAME_DESC_SZ);
>
> return rsi_send_internal_mgmt_frame(common, skb);
> @@ -617,7 +603,8 @@ static int rsi_program_bb_rf(struct rsi_common *common)
> *
> * Return: 0 on success, corresponding negative error code on failure.
> */
> -int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
> +int rsi_set_vap_capabilities(struct rsi_common *common,
> + enum opmode mode)
was original line over 80 characters? indentation is wrong.
> {
> struct sk_buff *skb = NULL;
> struct rsi_vap_caps *vap_caps;
> @@ -626,14 +613,12 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
> struct ieee80211_conf *conf = &hw->conf;
> u16 vap_id = 0;
>
> - rsi_dbg(MGMT_TX_ZONE, "%s: Sending VAP capabilities frame\n", __func__);
> + rsi_dbg(MGMT_TX_ZONE,
> + "%s: Sending VAP capabilities frame\n", __func__);
>
> skb = dev_alloc_skb(sizeof(struct rsi_vap_caps));
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, sizeof(struct rsi_vap_caps));
> vap_caps = (struct rsi_vap_caps *)skb->data;
> @@ -705,11 +690,8 @@ int rsi_hal_load_key(struct rsi_common *common,
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending load key frame\n", __func__);
>
> skb = dev_alloc_skb(sizeof(struct rsi_set_key));
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, sizeof(struct rsi_set_key));
> set_key = (struct rsi_set_key *)skb->data;
> @@ -736,13 +718,10 @@ int rsi_hal_load_key(struct rsi_common *common,
> set_key->desc_word[4] = cpu_to_le16(key_descriptor);
>
> if ((cipher == WLAN_CIPHER_SUITE_WEP40) ||
> - (cipher == WLAN_CIPHER_SUITE_WEP104)) {
> - memcpy(&set_key->key[key_id][1],
> - data,
> - key_len * 2);
> - } else {
> + (cipher == WLAN_CIPHER_SUITE_WEP104))
> + memcpy(&set_key->key[key_id][1], data, key_len * 2);
> + else
> memcpy(&set_key->key[0][0], data, key_len);
> - }
>
> memcpy(set_key->tx_mic_key, &data[16], 8);
> memcpy(set_key->rx_mic_key, &data[24], 8);
> @@ -765,11 +744,8 @@ static int rsi_load_bootup_params(struct rsi_common *common)
>
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending boot params frame\n", __func__);
> skb = dev_alloc_skb(sizeof(struct rsi_boot_params));
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, sizeof(struct rsi_boot_params));
> boot_params = (struct rsi_boot_params *)skb->data;
> @@ -780,7 +756,8 @@ static int rsi_load_bootup_params(struct rsi_common *common)
> memcpy(&boot_params->bootup_params,
> &boot_params_40,
> sizeof(struct bootup_params));
> - rsi_dbg(MGMT_TX_ZONE, "%s: Packet 40MHZ <=== %d\n", __func__,
> + rsi_dbg(MGMT_TX_ZONE,
> + "%s: Packet 40MHZ <=== %d\n", __func__,
> UMAC_CLK_40BW);
> boot_params->desc_word[7] = cpu_to_le16(UMAC_CLK_40BW);
> } else {
> @@ -828,11 +805,8 @@ static int rsi_send_reset_mac(struct rsi_common *common)
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending reset MAC frame\n", __func__);
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
> @@ -919,11 +893,8 @@ int rsi_set_channel(struct rsi_common *common, u16 channel)
> "%s: Sending scan req frame\n", __func__);
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
> @@ -980,6 +951,7 @@ static int rsi_compare(const void *a, const void *b)
> static bool rsi_map_rates(u16 rate, int *offset)
> {
> int kk;
> +
> for (kk = 0; kk < ARRAY_SIZE(rsi_mcsrates); kk++) {
> if (rate == mcs[kk]) {
> *offset = kk;
> @@ -1013,20 +985,14 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
> u8 num_supported_rates = 0;
> u8 rate_table_offset, rate_offset = 0;
> u32 rate_bitmap = common->bitrate_mask[band];
> -
> u16 *selected_rates, min_rate;
>
> skb = dev_alloc_skb(sizeof(struct rsi_auto_rate));
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> selected_rates = kzalloc(2 * RSI_TBL_SZ, GFP_KERNEL);
> if (!selected_rates) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of mem\n",
> - __func__);
> dev_kfree_skb(skb);
> return -ENOMEM;
> }
> @@ -1140,14 +1106,17 @@ void rsi_inform_bss_status(struct rsi_common *common,
> u16 aid)
> {
> if (status) {
> + common->hw_data_qs_blocked = true;
> rsi_hal_send_sta_notify_frame(common,
> RSI_IFTYPE_STATION,
> STA_CONNECTED,
> bssid,
> qos_enable,
> aid);
> - if (common->min_rate == 0xffff)
> + if (common->min_rate == 0xffff) {
> + rsi_dbg(INFO_ZONE, "Send auto rate request\n");
> rsi_send_auto_rate_request(common);
> + }
> } else {
> rsi_hal_send_sta_notify_frame(common,
> RSI_IFTYPE_STATION,
> @@ -1170,14 +1139,12 @@ static int rsi_eeprom_read(struct rsi_common *common)
> struct rsi_mac_frame *mgmt_frame;
> struct sk_buff *skb;
>
> - rsi_dbg(MGMT_TX_ZONE, "%s: Sending EEPROM read req frame\n", __func__);
> + rsi_dbg(MGMT_TX_ZONE,
> + "%s: Sending EEPROM read req frame\n", __func__);
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
> @@ -1214,11 +1181,8 @@ int rsi_send_block_unblock_frame(struct rsi_common *common, bool block_event)
> rsi_dbg(MGMT_TX_ZONE, "%s: Sending block/unblock frame\n", __func__);
>
> skb = dev_alloc_skb(FRAME_DESC_SZ);
> - if (!skb) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
> - __func__);
> + if (!skb)
> return -ENOMEM;
> - }
>
> memset(skb->data, 0, FRAME_DESC_SZ);
> mgmt_frame = (struct rsi_mac_frame *)skb->data;
> @@ -1261,9 +1225,8 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
> if (rsi_eeprom_read(common)) {
> common->fsm_state = FSM_CARD_NOT_READY;
> goto out;
> - } else {
> + } else
> common->fsm_state = FSM_EEPROM_READ_MAC_ADDR;
> - }
> } else {
> rsi_dbg(INFO_ZONE,
> "%s: Received bootup params cfm in %d state\n",
> @@ -1273,6 +1236,9 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
> break;
>
> case EEPROM_READ_TYPE:
> + rsi_dbg(FSM_ZONE,
> + "%s: EEPROM READ confirm received\n",
> + __func__);
> if (common->fsm_state == FSM_EEPROM_READ_MAC_ADDR) {
> if (msg[16] == MAGIC_WORD) {
> u8 offset = (FRAME_DESC_SZ + WLAN_HOST_MODE_LEN
> @@ -1324,7 +1290,8 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
> goto out;
> } else {
> common->fsm_state = FSM_BB_RF_PROG_SENT;
> - rsi_dbg(FSM_ZONE, "%s: Radio cap cfm received\n",
> + rsi_dbg(FSM_ZONE,
> + "%s: Radio cap cfm received\n",
> __func__);
> }
> } else {
> @@ -1347,27 +1314,29 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
> }
> } else {
> rsi_dbg(INFO_ZONE,
> - "%s: Received bbb_rf cfm in %d state\n",
> + "%s: Received bb_rf cfm in %d state\n",
> __func__, common->fsm_state);
> return 0;
> }
> break;
>
> default:
> - rsi_dbg(INFO_ZONE, "%s: Invalid TA confirm pkt received\n",
> + rsi_dbg(INFO_ZONE,
> + "%s: Invalid TA confirm pkt received\n",
> __func__);
> break;
> }
> return 0;
> out:
> - rsi_dbg(ERR_ZONE, "%s: Unable to send pkt/Invalid frame received\n",
> + rsi_dbg(ERR_ZONE,
> + "%s: Unable to send pkt/Invalid frame received\n",
> __func__);
> return -EINVAL;
> }
>
> /**
> * rsi_mgmt_pkt_recv() - This function processes the management packets
> - * recieved from the hardware.
> + * received from the hardware.
> * @common: Pointer to the driver private structure.
> * @msg: Pointer to the received packet.
> *
> @@ -1376,7 +1345,7 @@ out:
> int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
> {
> s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff);
> - u16 msg_type = (msg[2]);
> + u16 msg_type = msg[2];
> int ret;
>
> rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n",
> @@ -1404,8 +1373,8 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
> rsi_dbg(FSM_ZONE, "%s: Probe confirm received\n",
> __func__);
> }
> - } else {
> + } else
> return rsi_mgmt_pkt_to_core(common, msg, msg_len, msg_type);
> - }
> +
> return 0;
> }
> diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
> index 8428858..331865b 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
> @@ -1,6 +1,8 @@
> /**
> * Copyright (c) 2014 Redpine Signals Inc.
> *
> + * Developers:
> + * Fariya Fathima 2014 <fariya.f@redpinesignals.com>
> * Permission to use, copy, modify, and/or distribute this software for any
> * purpose with or without fee is hereby granted, provided that the above
> * copyright notice and this permission notice appear in all copies.
> @@ -128,7 +130,7 @@ static int rsi_issue_sdiocommand(struct sdio_func *func,
> }
>
> /**
> - * rsi_handle_interrupt() - This function is called upon the occurence
> + * rsi_handle_interrupt() - This function is called upon the occurrence
> * of an interrupt.
> * @function: Pointer to the sdio_func structure.
> *
> @@ -183,7 +185,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
> host->ios.timing = MMC_TIMING_LEGACY;
> host->ops->set_ios(host, &host->ios);
>
> - /*
> + /**
> * This delay should be sufficient to allow the power supply
> * to reach the minimum voltage.
> */
What is your intent here. Not sure if kerneldoc will pick this up.
> @@ -193,7 +195,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
> host->ios.power_mode = MMC_POWER_ON;
> host->ops->set_ios(host, &host->ios);
>
> - /*
> + /**
> * This delay must be at least 74 clock sizes, or 1 ms, or the
> * time required to reach a stable voltage.
> */
> @@ -361,6 +363,7 @@ static int rsi_setblocklength(struct rsi_hw *adapter, u32 length)
> struct rsi_91x_sdiodev *dev =
> (struct rsi_91x_sdiodev *)adapter->rsi_dev;
> int status;
> +
> rsi_dbg(INIT_ZONE, "%s: Setting the block length\n", __func__);
>
> status = sdio_set_block_size(dev->pfunction, length);
> @@ -464,6 +467,7 @@ int rsi_sdio_write_register(struct rsi_hw *adapter,
> void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit)
> {
> int status;
> +
> status = rsi_sdio_write_register(adapter,
> 1,
> (SDIO_FUN1_INTR_CLR_REG |
> @@ -473,8 +477,6 @@ void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit)
> rsi_dbg(ERR_ZONE, "%s: unable to send ack\n", __func__);
> }
>
> -
> -
> /**
> * rsi_sdio_read_register_multiple() - This function read multiple bytes of
> * information from the SD card.
> @@ -667,7 +669,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
> goto fail;
> }
>
> - rsi_dbg(INIT_ZONE, "%s: Setup card succesfully\n", __func__);
> + rsi_dbg(INIT_ZONE, "%s: Setup card successfully\n", __func__);
>
> status = rsi_init_sdio_slave_regs(adapter);
> if (status) {
> diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
> index 40d7231..ae42391 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
> @@ -252,11 +252,8 @@ static int rsi_process_pkt(struct rsi_common *common)
> rcv_pkt_len = (num_blks * 256);
>
> common->rx_data_pkt = kmalloc(rcv_pkt_len, GFP_KERNEL);
> - if (!common->rx_data_pkt) {
> - rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n",
> - __func__);
> + if (!common->rx_data_pkt)
> return -ENOMEM;
> - }
>
> status = rsi_sdio_host_intf_read_pkt(adapter,
> common->rx_data_pkt,
> @@ -426,8 +423,8 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
> "%s: ==> FIRMWARE Assert <==\n",
> __func__);
> status = rsi_sdio_read_register(common->priv,
> - SDIO_FW_STATUS_REG,
> - &fw_status);
> + SDIO_FW_STATUS_REG,
> + &fw_status);
> if (status) {
> rsi_dbg(ERR_ZONE,
> "%s: Failed to read f/w reg\n",
> @@ -435,7 +432,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
> } else {
> rsi_dbg(ERR_ZONE,
> "%s: Firmware Status is 0x%x\n",
> - __func__ , fw_status);
> + __func__, fw_status);
> rsi_sdio_ack_intr(common->priv,
> (1 << FW_ASSERT_IND));
> }
> diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
> index ef5d394..2b322e5 100644
> --- a/drivers/net/wireless/rsi/rsi_91x_usb.c
> +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
> @@ -1,6 +1,9 @@
> /**
> * Copyright (c) 2014 Redpine Signals Inc.
> *
> + * Developers:
> + * Prameela Rani Garnepudi 2016 <prameela.garnepudi@redpinesignals.com>
> + *
> * Permission to use, copy, modify, and/or distribute this software for any
> * purpose with or without fee is hereby granted, provided that the above
> * copyright notice and this permission notice appear in all copies.
> @@ -43,7 +46,6 @@ static int rsi_usb_card_write(struct rsi_hw *adapter,
> len,
> &transfer,
> HZ * 5);
> -
> if (status < 0) {
> rsi_dbg(ERR_ZONE,
> "Card write failed with error code :%10d\n", status);
> @@ -275,11 +277,11 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter)
>
> /**
> * rsi_usb_write_register_multiple() - This function writes multiple bytes of
> - * information to multiple registers.
> - * @adapter: Pointer to the adapter structure.
> - * @addr: Address of the register.
> - * @data: Pointer to the data that has to be written.
> - * @count: Number of multiple bytes to be written on to the registers.
> + * information to the given address.
> + * @adapter: Pointer to the adapter structure.
> + * @addr: Address of the register.
> + * @data: Pointer to the data that has to be written.
> + * @count: Number of multiple bytes to be written on to the registers.
> *
> * Return: status: 0 on success, a negative error code on failure.
> */
> @@ -392,11 +394,8 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter,
> usb_set_intfdata(pfunction, adapter);
>
> common->rx_data_pkt = kmalloc(2048, GFP_KERNEL);
> - if (!common->rx_data_pkt) {
> - rsi_dbg(ERR_ZONE, "%s: Failed to allocate memory\n",
> - __func__);
> + if (!common->rx_data_pkt)
> return -ENOMEM;
> - }
>
> rsi_dev->tx_buffer = kmalloc(2048, GFP_KERNEL);
> if (!rsi_dev->tx_buffer) {
> @@ -568,7 +567,20 @@ static struct usb_driver rsi_driver = {
> #endif
> };
>
> -module_usb_driver(rsi_driver);
> +static int __init rsi_usb_module_init(void)
> +{
> + rsi_dbg(INIT_ZONE,
> + "=====> RSI USB Module Initialize <=====\n");
> + return usb_register(&rsi_driver);
> +}
> +
> +static void __exit rsi_usb_module_exit(void)
> +{
> + usb_deregister(&rsi_driver);
> +}
> +
> +module_init(rsi_usb_module_init);
> +module_exit(rsi_usb_module_exit);
>
> MODULE_AUTHOR("Redpine Signals Inc");
> MODULE_DESCRIPTION("Common USB layer for RSI drivers");
> diff --git a/drivers/net/wireless/rsi/rsi_common.h b/drivers/net/wireless/rsi/rsi_common.h
> index d3fbe33..ad1be13 100644
> --- a/drivers/net/wireless/rsi/rsi_common.h
> +++ b/drivers/net/wireless/rsi/rsi_common.h
> @@ -38,7 +38,7 @@ static inline int rsi_wait_event(struct rsi_event *event, u32 timeout)
>
> if (!timeout)
> status = wait_event_interruptible(event->event_queue,
> - (atomic_read(&event->event_condition) == 0));
> + (!atomic_read(&event->event_condition)));
> else
> status = wait_event_interruptible_timeout(event->event_queue,
> (atomic_read(&event->event_condition) == 0),
> diff --git a/drivers/net/wireless/rsi/rsi_debugfs.h b/drivers/net/wireless/rsi/rsi_debugfs.h
> index 580ad3b..8b64944 100644
> --- a/drivers/net/wireless/rsi/rsi_debugfs.h
> +++ b/drivers/net/wireless/rsi/rsi_debugfs.h
> @@ -23,12 +23,10 @@
> #ifndef CONFIG_RSI_DEBUGFS
> static inline int rsi_init_dbgfs(struct rsi_hw *adapter)
> {
> - return 0;
removing this should result in compiler warning or am I missing
something here.
> }
>
> static inline void rsi_remove_dbgfs(struct rsi_hw *adapter)
> {
> - return;
> }
> #else
> struct rsi_dbg_files {
> @@ -42,6 +40,7 @@ struct rsi_debugfs {
> struct rsi_dbg_ops *dfs_get_ops;
> struct dentry *rsi_files[MAX_DEBUGFS_ENTRIES];
> };
> +
> int rsi_init_dbgfs(struct rsi_hw *adapter);
> void rsi_remove_dbgfs(struct rsi_hw *adapter);
> #endif
> diff --git a/drivers/net/wireless/rsi/rsi_main.h b/drivers/net/wireless/rsi/rsi_main.h
> index dcd0957..cde1a75 100644
> --- a/drivers/net/wireless/rsi/rsi_main.h
> +++ b/drivers/net/wireless/rsi/rsi_main.h
> @@ -21,23 +21,25 @@
> #include <linux/skbuff.h>
> #include <net/mac80211.h>
>
> -#define ERR_ZONE BIT(0) /* For Error Msgs */
> -#define INFO_ZONE BIT(1) /* For General Status Msgs */
> -#define INIT_ZONE BIT(2) /* For Driver Init Seq Msgs */
> -#define MGMT_TX_ZONE BIT(3) /* For TX Mgmt Path Msgs */
> -#define MGMT_RX_ZONE BIT(4) /* For RX Mgmt Path Msgs */
> -#define DATA_TX_ZONE BIT(5) /* For TX Data Path Msgs */
> -#define DATA_RX_ZONE BIT(6) /* For RX Data Path Msgs */
> -#define FSM_ZONE BIT(7) /* For State Machine Msgs */
> -#define ISR_ZONE BIT(8) /* For Interrupt Msgs */
> +#define ERR_ZONE BIT(0) /* Error Msgs */
> +#define INFO_ZONE BIT(1) /* General Debug Msgs */
> +#define INIT_ZONE BIT(2) /* Driver Init Msgs */
> +#define MGMT_TX_ZONE BIT(3) /* TX Mgmt Path Msgs */
> +#define MGMT_RX_ZONE BIT(4) /* RX Mgmt Path Msgs */
> +#define DATA_TX_ZONE BIT(5) /* TX Data Path Msgs */
> +#define DATA_RX_ZONE BIT(6) /* RX Data Path Msgs */
> +#define FSM_ZONE BIT(7) /* State Machine Msgs */
> +#define ISR_ZONE BIT(8) /* Interrupt Msgs */
>
> #define FSM_CARD_NOT_READY 0
> -#define FSM_BOOT_PARAMS_SENT 1
> -#define FSM_EEPROM_READ_MAC_ADDR 2
> -#define FSM_RESET_MAC_SENT 3
> -#define FSM_RADIO_CAPS_SENT 4
> -#define FSM_BB_RF_PROG_SENT 5
> -#define FSM_MAC_INIT_DONE 6
> +#define FSM_COMMON_DEV_PARAMS_SENT 1
> +#define FSM_BOOT_PARAMS_SENT 2
> +#define FSM_EEPROM_READ_MAC_ADDR 3
> +#define FSM_EEPROM_READ_RF_TYPE 4
> +#define FSM_RESET_MAC_SENT 5
> +#define FSM_RADIO_CAPS_SENT 6
> +#define FSM_BB_RF_PROG_SENT 7
> +#define FSM_MAC_INIT_DONE 8
>
> extern u32 rsi_zone_enabled;
> extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...);
> @@ -206,12 +208,14 @@ struct rsi_common {
> bool hw_data_qs_blocked;
> };
>
> +#define IEEE80211_NUM_BANDS 2
> +
> struct rsi_hw {
> struct rsi_common *priv;
> struct ieee80211_hw *hw;
> struct ieee80211_vif *vifs[RSI_MAX_VIFS];
> struct ieee80211_tx_queue_params edca_params[NUM_EDCA_QUEUES];
> - struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
> + struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
>
> struct device *device;
> u8 sc_nvifs;
> diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h
> index 3741173..ed3aa83 100644
> --- a/drivers/net/wireless/rsi/rsi_mgmt.h
> +++ b/drivers/net/wireless/rsi/rsi_mgmt.h
> @@ -71,31 +71,31 @@
> #define RSI_ENABLE_40MHZ (0x1 << 3)
> #define ENABLE_SHORTGI_RATE BIT(9)
>
> -#define RX_BA_INDICATION 1
> -#define RSI_TBL_SZ 40
> -#define MAX_RETRIES 8
> +#define RX_BA_INDICATION 1
> +#define RSI_TBL_SZ 40
> +#define MAX_RETRIES 8
> #define RSI_IFTYPE_STATION 0
>
> -#define STD_RATE_MCS7 0x07
> -#define STD_RATE_MCS6 0x06
> -#define STD_RATE_MCS5 0x05
> -#define STD_RATE_MCS4 0x04
> -#define STD_RATE_MCS3 0x03
> -#define STD_RATE_MCS2 0x02
> -#define STD_RATE_MCS1 0x01
> -#define STD_RATE_MCS0 0x00
> -#define STD_RATE_54 0x6c
> -#define STD_RATE_48 0x60
> -#define STD_RATE_36 0x48
> -#define STD_RATE_24 0x30
> -#define STD_RATE_18 0x24
> -#define STD_RATE_12 0x18
> -#define STD_RATE_11 0x16
> -#define STD_RATE_09 0x12
> -#define STD_RATE_06 0x0C
> -#define STD_RATE_5_5 0x0B
> -#define STD_RATE_02 0x04
> -#define STD_RATE_01 0x02
> +#define STD_RATE_MCS7 0x07
> +#define STD_RATE_MCS6 0x06
> +#define STD_RATE_MCS5 0x05
> +#define STD_RATE_MCS4 0x04
> +#define STD_RATE_MCS3 0x03
> +#define STD_RATE_MCS2 0x02
> +#define STD_RATE_MCS1 0x01
> +#define STD_RATE_MCS0 0x00
> +#define STD_RATE_54 0x6c
> +#define STD_RATE_48 0x60
> +#define STD_RATE_36 0x48
> +#define STD_RATE_24 0x30
> +#define STD_RATE_18 0x24
> +#define STD_RATE_12 0x18
> +#define STD_RATE_11 0x16
> +#define STD_RATE_09 0x12
> +#define STD_RATE_06 0x0C
> +#define STD_RATE_5_5 0x0B
> +#define STD_RATE_02 0x04
> +#define STD_RATE_01 0x02
>
> #define RSI_RF_TYPE 1
> #define RSI_RATE_00 0x00
> @@ -173,9 +173,9 @@ enum cmd_frame_type {
> AUTO_RATE_IND,
> BOOTUP_PARAMS_REQUEST,
> VAP_CAPABILITIES,
> - EEPROM_READ_TYPE ,
> + EEPROM_READ_TYPE,
> EEPROM_WRITE,
> - GPIO_PIN_CONFIG ,
> + GPIO_PIN_CONFIG,
> SET_RX_FILTER,
> AMPDU_IND,
> STATS_REQUEST_FRAME,
> @@ -288,8 +288,8 @@ static inline u8 rsi_get_channel(u8 *addr)
>
> int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);
> int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode);
> -int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid,
> - u16 ssn, u8 buf_size, u8 event);
> +int rsi_send_aggr_params_frame(struct rsi_common *common, u16 tid,
> + u16 ssn, u8 buf_size, u8 event);
> int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
> u8 key_type, u8 key_id, u32 cipher);
> int rsi_set_channel(struct rsi_common *common, u16 chno);
> diff --git a/drivers/net/wireless/rsi/rsi_sdio.h b/drivers/net/wireless/rsi/rsi_sdio.h
> index c7e8f2b..33a657c 100644
> --- a/drivers/net/wireless/rsi/rsi_sdio.h
> +++ b/drivers/net/wireless/rsi/rsi_sdio.h
> @@ -37,17 +37,17 @@ enum sdio_interrupt_type {
> };
>
> /* Buffer status register related info */
> -#define PKT_BUFF_SEMI_FULL 0
> -#define PKT_BUFF_FULL 1
> -#define PKT_MGMT_BUFF_FULL 2
> -#define MSDU_PKT_PENDING 3
> +#define PKT_BUFF_SEMI_FULL 0
> +#define PKT_BUFF_FULL 1
> +#define PKT_MGMT_BUFF_FULL 2
> +#define MSDU_PKT_PENDING 3
> /* Interrupt Bit Related Macros */
> -#define PKT_BUFF_AVAILABLE 1
> -#define FW_ASSERT_IND 2
> +#define PKT_BUFF_AVAILABLE 1
> +#define FW_ASSERT_IND 2
>
> -#define RSI_DEVICE_BUFFER_STATUS_REGISTER 0xf3
> -#define RSI_FN1_INT_REGISTER 0xf9
> -#define RSI_SD_REQUEST_MASTER 0x10000
> +#define RSI_DEVICE_BUFFER_STATUS_REGISTER 0xf3
> +#define RSI_FN1_INT_REGISTER 0xf9
> +#define RSI_SD_REQUEST_MASTER 0x10000
>
> /* FOR SD CARD ONLY */
> #define SDIO_RX_NUM_BLOCKS_REG 0x000F1
>
^ permalink raw reply
* Re: [PATCH v3 3/3] mt76: add driver code for MT76x2e
From: Sergey Ryazanov @ 2016-09-08 8:29 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless@vger.kernel.org, Kalle Valo
In-Reply-To: <d65738be-cb30-cedd-562c-814d02a91794@nbd.name>
2016-09-08 11:25 GMT+03:00 Felix Fietkau <nbd@nbd.name>:
> On 2016-09-08 09:52, Sergey Ryazanov wrote:
>>> +
>>> +int mt76x2_register_device(struct mt76x2_dev *dev)
>>> +{
>>> + struct ieee80211_hw *hw = mt76_hw(dev);
>>> + struct wiphy *wiphy = hw->wiphy;
>>> + void *status_fifo;
>>> + int fifo_size;
>>> + int i, ret;
>>> +
>>> + fifo_size = roundup_pow_of_two(32 * sizeof(struct mt76x2_tx_status));
>>> + status_fifo = devm_kzalloc(dev->mt76.dev, fifo_size, GFP_KERNEL);
>>> + if (!status_fifo)
>>> + return -ENOMEM;
>>> +
>>> + kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size);
>>> +
>>> + ret = mt76x2_init_hardware(dev);
>>> + if (ret)
>>> + return ret;
>>> +
>>> + hw->queues = 4;
>>> + hw->max_rates = 1;
>>> + hw->max_report_rates = 7;
>>> + hw->max_rate_tries = 1;
>>> + hw->extra_tx_headroom = 2;
>>> +
>>> + hw->sta_data_size = sizeof(struct mt76x2_sta);
>>> + hw->vif_data_size = sizeof(struct mt76x2_vif);
>>> +
>>> + for (i = 0; i < ARRAY_SIZE(dev->macaddr_list); i++) {
>>> + u8 *addr = dev->macaddr_list[i].addr;
>>> +
>>> + memcpy(addr, dev->mt76.macaddr, ETH_ALEN);
>>> +
>>> + if (!i)
>>> + continue;
>>> +
>>> + addr[0] |= BIT(1);
>>> + addr[0] ^= ((i - 1) << 2);
>>> + }
>>> + wiphy->addresses = dev->macaddr_list;
>>> + wiphy->n_addresses = ARRAY_SIZE(dev->macaddr_list);
>>> +
>>> + wiphy->iface_combinations = if_comb;
>>> + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
>>> +
>>> + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
>>> +
>>> + ieee80211_hw_set(hw, SUPPORTS_HT_CCK_RATES);
>>> + INIT_DELAYED_WORK(&dev->cal_work, mt76x2_phy_calibrate);
>>> + INIT_DELAYED_WORK(&dev->mac_work, mt76x2_mac_work);
>>> +
>>> + dev->mt76.sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
>>> + dev->mt76.sband_5g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
>>> +
>>> + ret = mt76_register_device(&dev->mt76, true, mt76x2_rates,
>>> + ARRAY_SIZE(mt76x2_rates));
>>> + if (ret)
>>> + goto fail;
>>> +
>>> + mt76x2_init_debugfs(dev);
>>> +
>>> + return 0;
>>> +
>>> +fail:
>>> + mt76x2_stop_hardware(dev);
>>> + return ret;
>>> +}
>>
>> Just curious, almost full chip initialization performed in probe
>> procedure, why not do that in start() callback? In such case we could
>> fully restart chip without module reloading, just with ifdown/ifup
>> circle.
> Last time I tried that I ran into some weird chip quirks. I do think
> it's a good idea but I'd rather see this merged first and try again to
> rework it when I have some more time to figure out what's going on.
>
Got it. Thank you for explanation.
--
Sergey
^ permalink raw reply
* Re: [PATCH v3 3/3] mt76: add driver code for MT76x2e
From: Felix Fietkau @ 2016-09-08 8:25 UTC (permalink / raw)
To: Sergey Ryazanov; +Cc: linux-wireless@vger.kernel.org, Kalle Valo
In-Reply-To: <CAHNKnsTwBVmWSis_5EV1mrJM53E6XDhJ=CHWCjihZ839bDXGuA@mail.gmail.com>
On 2016-09-08 09:52, Sergey Ryazanov wrote:
>> +
>> +int mt76x2_register_device(struct mt76x2_dev *dev)
>> +{
>> + struct ieee80211_hw *hw = mt76_hw(dev);
>> + struct wiphy *wiphy = hw->wiphy;
>> + void *status_fifo;
>> + int fifo_size;
>> + int i, ret;
>> +
>> + fifo_size = roundup_pow_of_two(32 * sizeof(struct mt76x2_tx_status));
>> + status_fifo = devm_kzalloc(dev->mt76.dev, fifo_size, GFP_KERNEL);
>> + if (!status_fifo)
>> + return -ENOMEM;
>> +
>> + kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size);
>> +
>> + ret = mt76x2_init_hardware(dev);
>> + if (ret)
>> + return ret;
>> +
>> + hw->queues = 4;
>> + hw->max_rates = 1;
>> + hw->max_report_rates = 7;
>> + hw->max_rate_tries = 1;
>> + hw->extra_tx_headroom = 2;
>> +
>> + hw->sta_data_size = sizeof(struct mt76x2_sta);
>> + hw->vif_data_size = sizeof(struct mt76x2_vif);
>> +
>> + for (i = 0; i < ARRAY_SIZE(dev->macaddr_list); i++) {
>> + u8 *addr = dev->macaddr_list[i].addr;
>> +
>> + memcpy(addr, dev->mt76.macaddr, ETH_ALEN);
>> +
>> + if (!i)
>> + continue;
>> +
>> + addr[0] |= BIT(1);
>> + addr[0] ^= ((i - 1) << 2);
>> + }
>> + wiphy->addresses = dev->macaddr_list;
>> + wiphy->n_addresses = ARRAY_SIZE(dev->macaddr_list);
>> +
>> + wiphy->iface_combinations = if_comb;
>> + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
>> +
>> + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
>> +
>> + ieee80211_hw_set(hw, SUPPORTS_HT_CCK_RATES);
>> + INIT_DELAYED_WORK(&dev->cal_work, mt76x2_phy_calibrate);
>> + INIT_DELAYED_WORK(&dev->mac_work, mt76x2_mac_work);
>> +
>> + dev->mt76.sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
>> + dev->mt76.sband_5g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
>> +
>> + ret = mt76_register_device(&dev->mt76, true, mt76x2_rates,
>> + ARRAY_SIZE(mt76x2_rates));
>> + if (ret)
>> + goto fail;
>> +
>> + mt76x2_init_debugfs(dev);
>> +
>> + return 0;
>> +
>> +fail:
>> + mt76x2_stop_hardware(dev);
>> + return ret;
>> +}
>
> Just curious, almost full chip initialization performed in probe
> procedure, why not do that in start() callback? In such case we could
> fully restart chip without module reloading, just with ifdown/ifup
> circle.
Last time I tried that I ran into some weird chip quirks. I do think
it's a good idea but I'd rather see this merged first and try again to
rework it when I have some more time to figure out what's going on.
- Felix
^ permalink raw reply
* Re: [PATCH v3 3/3] mt76: add driver code for MT76x2e
From: Sergey Ryazanov @ 2016-09-08 7:52 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless@vger.kernel.org, Kalle Valo
In-Reply-To: <20160905095128.80560-4-nbd@nbd.name>
First of all I would like to thank you Felix for this great job!
Please find one simple question below.
2016-09-05 12:51 GMT+03:00 Felix Fietkau <nbd@nbd.name>:
> From: Felix Fietkau <nbd@openwrt.org>
>
> This is a 2x2 PCIe 802.11ac chipset by MediaTek
>
[skip]
> +int mt76x2_init_hardware(struct mt76x2_dev *dev)
> +{
> + static const u16 beacon_offsets[16] = {
> + /* 1024 byte per beacon */
> + 0xc000,
> + 0xc400,
> + 0xc800,
> + 0xcc00,
> + 0xd000,
> + 0xd400,
> + 0xd800,
> + 0xdc00,
> +
> + /* BSS idx 8-15 not used for beacons */
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + 0xc000,
> + };
> + u32 val;
> + int ret;
> +
> + dev->beacon_offsets = beacon_offsets;
> + tasklet_init(&dev->pre_tbtt_tasklet, mt76x2_pre_tbtt_tasklet,
> + (unsigned long) dev);
> +
> + dev->chainmask = 0x202;
> + dev->global_wcid.idx = 255;
> + dev->global_wcid.hw_key_idx = -1;
> + dev->slottime = 9;
> +
> + val = mt76_rr(dev, MT_WPDMA_GLO_CFG);
> + val &= MT_WPDMA_GLO_CFG_DMA_BURST_SIZE |
> + MT_WPDMA_GLO_CFG_BIG_ENDIAN |
> + MT_WPDMA_GLO_CFG_HDR_SEG_LEN;
> + val |= MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE;
> + mt76_wr(dev, MT_WPDMA_GLO_CFG, val);
> +
> + mt76x2_reset_wlan(dev, true);
> + mt76x2_power_on(dev);
> +
> + ret = mt76x2_eeprom_init(dev);
> + if (ret)
> + return ret;
> +
> + ret = mt76x2_mac_reset(dev, true);
> + if (ret)
> + return ret;
> +
> + ret = mt76x2_dma_init(dev);
> + if (ret)
> + return ret;
> +
> + set_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
> + ret = mt76x2_mac_start(dev);
> + if (ret)
> + return ret;
> +
> + ret = mt76x2_mcu_init(dev);
> + if (ret)
> + return ret;
> +
> + mt76x2_mac_stop(dev, false);
> + dev->rxfilter = mt76_rr(dev, MT_RX_FILTR_CFG);
> +
> + return 0;
> +}
[skip]
> +
> +int mt76x2_register_device(struct mt76x2_dev *dev)
> +{
> + struct ieee80211_hw *hw = mt76_hw(dev);
> + struct wiphy *wiphy = hw->wiphy;
> + void *status_fifo;
> + int fifo_size;
> + int i, ret;
> +
> + fifo_size = roundup_pow_of_two(32 * sizeof(struct mt76x2_tx_status));
> + status_fifo = devm_kzalloc(dev->mt76.dev, fifo_size, GFP_KERNEL);
> + if (!status_fifo)
> + return -ENOMEM;
> +
> + kfifo_init(&dev->txstatus_fifo, status_fifo, fifo_size);
> +
> + ret = mt76x2_init_hardware(dev);
> + if (ret)
> + return ret;
> +
> + hw->queues = 4;
> + hw->max_rates = 1;
> + hw->max_report_rates = 7;
> + hw->max_rate_tries = 1;
> + hw->extra_tx_headroom = 2;
> +
> + hw->sta_data_size = sizeof(struct mt76x2_sta);
> + hw->vif_data_size = sizeof(struct mt76x2_vif);
> +
> + for (i = 0; i < ARRAY_SIZE(dev->macaddr_list); i++) {
> + u8 *addr = dev->macaddr_list[i].addr;
> +
> + memcpy(addr, dev->mt76.macaddr, ETH_ALEN);
> +
> + if (!i)
> + continue;
> +
> + addr[0] |= BIT(1);
> + addr[0] ^= ((i - 1) << 2);
> + }
> + wiphy->addresses = dev->macaddr_list;
> + wiphy->n_addresses = ARRAY_SIZE(dev->macaddr_list);
> +
> + wiphy->iface_combinations = if_comb;
> + wiphy->n_iface_combinations = ARRAY_SIZE(if_comb);
> +
> + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
> +
> + ieee80211_hw_set(hw, SUPPORTS_HT_CCK_RATES);
> + INIT_DELAYED_WORK(&dev->cal_work, mt76x2_phy_calibrate);
> + INIT_DELAYED_WORK(&dev->mac_work, mt76x2_mac_work);
> +
> + dev->mt76.sband_2g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
> + dev->mt76.sband_5g.sband.ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
> +
> + ret = mt76_register_device(&dev->mt76, true, mt76x2_rates,
> + ARRAY_SIZE(mt76x2_rates));
> + if (ret)
> + goto fail;
> +
> + mt76x2_init_debugfs(dev);
> +
> + return 0;
> +
> +fail:
> + mt76x2_stop_hardware(dev);
> + return ret;
> +}
Just curious, almost full chip initialization performed in probe
procedure, why not do that in start() callback? In such case we could
fully restart chip without module reloading, just with ifdown/ifup
circle.
--
Sergey
^ permalink raw reply
* [PATCH] rsi: code clean-up
From: Prameela Rani Garnepudi @ 2016-09-08 5:36 UTC (permalink / raw)
To: linux-wireless, kvalo, johannes.berg, hofrat, xypron.glpk
Cc: prameela.j04cs, Prameela Rani Garnepudi
From: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
Signed-off-by: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
---
drivers/net/wireless/rsi/rsi_91x_core.c | 18 ++--
drivers/net/wireless/rsi/rsi_91x_debugfs.c | 13 +--
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 81 +++++++++------
drivers/net/wireless/rsi/rsi_91x_main.c | 16 ++-
drivers/net/wireless/rsi/rsi_91x_mgmt.c | 155 +++++++++++-----------------
drivers/net/wireless/rsi/rsi_91x_sdio.c | 14 +--
drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | 11 +-
drivers/net/wireless/rsi/rsi_91x_usb.c | 34 ++++--
drivers/net/wireless/rsi/rsi_common.h | 2 +-
drivers/net/wireless/rsi/rsi_debugfs.h | 3 +-
drivers/net/wireless/rsi/rsi_main.h | 36 ++++---
drivers/net/wireless/rsi/rsi_mgmt.h | 54 +++++-----
drivers/net/wireless/rsi/rsi_sdio.h | 18 ++--
13 files changed, 228 insertions(+), 227 deletions(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c
index f3d3995..c6db8a9 100644
--- a/drivers/net/wireless/rsi/rsi_91x_core.c
+++ b/drivers/net/wireless/rsi/rsi_91x_core.c
@@ -134,7 +134,7 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
bool recontend_queue = false;
u32 q_len = 0;
u8 q_num = INVALID_QUEUE;
- u8 ii = 0;
+ u8 ii;
if (skb_queue_len(&common->tx_queue[MGMT_SOFT_Q])) {
if (!common->mgmt_q_block)
@@ -142,8 +142,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)
return q_num;
}
- if (common->hw_data_qs_blocked)
+ if (common->hw_data_qs_blocked) {
+ rsi_dbg(INFO_ZONE, "%s: data queue blocked\n", __func__);
return q_num;
+ }
if (common->pkt_cnt != 0) {
--common->pkt_cnt;
@@ -210,6 +212,7 @@ static void rsi_core_queue_pkt(struct rsi_common *common,
struct sk_buff *skb)
{
u8 q_num = skb->priority;
+
if (q_num >= NUM_SOFT_QUEUES) {
rsi_dbg(ERR_ZONE, "%s: Invalid Queue Number: q_num = %d\n",
__func__, q_num);
@@ -285,7 +288,7 @@ void rsi_core_qos_processor(struct rsi_common *common)
}
skb = rsi_core_dequeue_pkt(common, q_num);
- if (skb == NULL) {
+ if (!skb) {
rsi_dbg(ERR_ZONE, "skb null\n");
mutex_unlock(&common->tx_rxlock);
break;
@@ -331,15 +334,16 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
__func__);
goto xmit_fail;
}
- info = IEEE80211_SKB_CB(skb);
- tx_params = (struct skb_info *)info->driver_data;
- tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
if (common->fsm_state != FSM_MAC_INIT_DONE) {
rsi_dbg(ERR_ZONE, "%s: FSM state not open\n", __func__);
goto xmit_fail;
}
+ info = IEEE80211_SKB_CB(skb);
+ tx_params = (struct skb_info *)info->driver_data;
+ tmp_hdr = (struct ieee80211_hdr *)&skb->data[0];
+
if ((ieee80211_is_mgmt(tmp_hdr->frame_control)) ||
(ieee80211_is_ctl(tmp_hdr->frame_control)) ||
(ieee80211_is_qos_nullfunc(tmp_hdr->frame_control))) {
@@ -360,7 +364,7 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)
if ((q_num != MGMT_SOFT_Q) &&
((skb_queue_len(&common->tx_queue[q_num]) + 1) >=
- DATA_QUEUE_WATER_MARK)) {
+ DATA_QUEUE_WATER_MARK)) {
rsi_dbg(ERR_ZONE, "%s: sw queue full\n", __func__);
if (!ieee80211_queue_stopped(adapter->hw, WME_AC(q_num)))
ieee80211_stop_queue(adapter->hw, WME_AC(q_num));
diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
index 828a042..5ec7bce 100644
--- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c
+++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c
@@ -59,7 +59,7 @@ static int rsi_sdio_stats_read(struct seq_file *seq, void *data)
}
/**
- * rsi_sdio_stats_open() - This funtion calls single open function of seq_file
+ * rsi_sdio_stats_open() - This function calls single open function of seq_file
* to open file and read contents from it.
* @inode: Pointer to the inode structure.
* @file: Pointer to the file structure.
@@ -100,7 +100,7 @@ static int rsi_version_read(struct seq_file *seq, void *data)
}
/**
- * rsi_version_open() - This funtion calls single open function of seq_file to
+ * rsi_version_open() - This function calls single open function of seq_file to
* open file and read contents from it.
* @inode: Pointer to the inode structure.
* @file: Pointer to the file structure.
@@ -108,7 +108,7 @@ static int rsi_version_read(struct seq_file *seq, void *data)
* Return: Pointer to the opened file status: 0 on success, ENOMEM on failure.
*/
static int rsi_version_open(struct inode *inode,
- struct file *file)
+ struct file *file)
{
return single_open(file, rsi_version_read, inode->i_private);
}
@@ -180,7 +180,7 @@ static int rsi_stats_read(struct seq_file *seq, void *data)
}
/**
- * rsi_stats_open() - This funtion calls single open function of seq_file to
+ * rsi_stats_open() - This function calls single open function of seq_file to
* open file and read contents from it.
* @inode: Pointer to the inode structure.
* @file: Pointer to the file structure.
@@ -194,7 +194,8 @@ static int rsi_stats_open(struct inode *inode,
}
/**
- * rsi_debug_zone_read() - This function display the currently enabled debug zones.
+ * rsi_debug_zone_read() - This function display the currently
+ * enabled debug zones.
* @seq: Pointer to the sequence file structure.
* @data: Pointer to the data.
*
@@ -209,7 +210,7 @@ static int rsi_debug_zone_read(struct seq_file *seq, void *data)
}
/**
- * rsi_debug_read() - This funtion calls single open function of seq_file to
+ * rsi_debug_read() - This function calls single open function of seq_file to
* open file and read contents from it.
* @inode: Pointer to the inode structure.
* @file: Pointer to the file structure.
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index dbb2389..9c6fa61 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -194,6 +194,7 @@ static void rsi_register_rates_channels(struct rsi_hw *adapter, int band)
void rsi_mac80211_detach(struct rsi_hw *adapter)
{
struct ieee80211_hw *hw = adapter->hw;
+ int i;
if (hw) {
ieee80211_stop_queues(hw);
@@ -201,7 +202,17 @@ void rsi_mac80211_detach(struct rsi_hw *adapter)
ieee80211_free_hw(hw);
}
+ for (i = 0; i < 2; i++) {
+ struct ieee80211_supported_band *sbands = &adapter->sbands[i];
+
+ if (!sbands->channels)
+ kfree(sbands->channels);
+ }
+
+#ifdef CONFIG_RSI_DEBUGFS
rsi_remove_dbgfs(adapter);
+ kfree(adapter->dfsentry);
+#endif
}
EXPORT_SYMBOL_GPL(rsi_mac80211_detach);
@@ -429,9 +440,11 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
u16 rsi_get_connected_channel(struct rsi_hw *adapter)
{
struct ieee80211_vif *vif = adapter->vifs[0];
+
if (vif) {
struct ieee80211_bss_conf *bss = &vif->bss_conf;
struct ieee80211_channel *channel = bss->chandef.chan;
+
return channel->hw_value;
}
@@ -667,15 +680,14 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_ampdu_params *params)
{
- int status = -EOPNOTSUPP;
+ int status = 1;
struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv;
- u16 seq_no = 0;
+ u16 seq_no = params->ssn;
u8 ii = 0;
struct ieee80211_sta *sta = params->sta;
enum ieee80211_ampdu_mlme_action action = params->action;
u16 tid = params->tid;
- u16 *ssn = ¶ms->ssn;
u8 buf_size = params->buf_size;
for (ii = 0; ii < RSI_MAX_VIFS; ii++) {
@@ -684,28 +696,30 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
}
mutex_lock(&common->mutex);
- rsi_dbg(INFO_ZONE, "%s: AMPDU action %d called\n", __func__, action);
- if (ssn != NULL)
- seq_no = *ssn;
switch (action) {
case IEEE80211_AMPDU_RX_START:
- status = rsi_send_aggregation_params_frame(common,
- tid,
- seq_no,
- buf_size,
- STA_RX_ADDBA_DONE);
+ rsi_dbg(INFO_ZONE, "AMPDU action RX_START (%d)\n", action);
+ status = rsi_send_aggr_params_frame(common,
+ tid,
+ seq_no,
+ buf_size,
+ STA_RX_ADDBA_DONE);
break;
case IEEE80211_AMPDU_RX_STOP:
- status = rsi_send_aggregation_params_frame(common,
- tid,
- 0,
- buf_size,
- STA_RX_DELBA);
+ rsi_dbg(INFO_ZONE,
+ "AMPDU action RX_STOP (%d) called\n", action);
+ status = rsi_send_aggr_params_frame(common,
+ tid,
+ 0,
+ buf_size,
+ STA_RX_DELBA);
break;
case IEEE80211_AMPDU_TX_START:
+ rsi_dbg(INFO_ZONE,
+ "AMPDU action TX_START (%d) called\n", action);
common->vif_info[ii].seq_start = seq_no;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
status = 0;
@@ -714,22 +728,27 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,
case IEEE80211_AMPDU_TX_STOP_CONT:
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
- status = rsi_send_aggregation_params_frame(common,
- tid,
- seq_no,
- buf_size,
- STA_TX_DELBA);
+ rsi_dbg(INFO_ZONE,
+ "AMPDU action TX_STOP_CONT / TX_STOP_FLUSH /"
+ " TX_STOP_FLUSH_CONT (%d) called\n", action);
+ status = rsi_send_aggr_params_frame(common,
+ tid,
+ seq_no,
+ buf_size,
+ STA_TX_DELBA);
if (!status)
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
- status = rsi_send_aggregation_params_frame(common,
- tid,
- common->vif_info[ii]
- .seq_start,
- buf_size,
- STA_TX_ADDBA_DONE);
+ rsi_dbg(INFO_ZONE,
+ "AMPDU action TX_OPERATIONAL(%d) called\n",
+ action);
+ status = rsi_send_aggr_params_frame(common,
+ tid,
+ common->vif_info[ii].seq_start,
+ buf_size,
+ STA_TX_ADDBA_DONE);
break;
default:
@@ -819,8 +838,6 @@ static void rsi_perform_cqm(struct rsi_common *common,
common->cqm_info.last_cqm_event_rssi = rssi;
rsi_dbg(INFO_ZONE, "CQM: Notifying event: %d\n", event);
ieee80211_cqm_rssi_notify(adapter->vifs[0], event, GFP_KERNEL);
-
- return;
}
/**
@@ -875,16 +892,14 @@ static void rsi_fill_rx_status(struct ieee80211_hw *hw,
}
/* CQM only for connected AP beacons, the RSSI is a weighted avg */
- if (bss->assoc && !(memcmp(bss->bssid, hdr->addr2, ETH_ALEN))) {
+ if (bss->assoc && ether_addr_equal(bss->bssid, hdr->addr2)) {
if (ieee80211_is_beacon(hdr->frame_control))
rsi_perform_cqm(common, hdr->addr2, rxs->signal);
}
-
- return;
}
/**
- * rsi_indicate_pkt_to_os() - This function sends recieved packet to mac80211.
+ * rsi_indicate_pkt_to_os() - This function sends received packet to mac80211.
* @common: Pointer to the driver private structure.
* @skb: Pointer to the socket buffer structure.
*
diff --git a/drivers/net/wireless/rsi/rsi_91x_main.c b/drivers/net/wireless/rsi/rsi_91x_main.c
index 8810862..f59a66a 100644
--- a/drivers/net/wireless/rsi/rsi_91x_main.c
+++ b/drivers/net/wireless/rsi/rsi_91x_main.c
@@ -86,7 +86,7 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
pkt_len -= extended_desc;
skb = dev_alloc_skb(pkt_len + FRAME_DESC_SZ);
- if (skb == NULL)
+ if (!skb)
return NULL;
payload_offset = (extended_desc + FRAME_DESC_SZ);
@@ -111,11 +111,10 @@ static struct sk_buff *rsi_prepare_skb(struct rsi_common *common,
int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
{
u8 *frame_desc = NULL, extended_desc = 0;
- u32 index, length = 0, queueno = 0;
+ u32 index = 0, length = 0, queueno = 0;
u16 actual_length = 0, offset;
struct sk_buff *skb = NULL;
- index = 0;
do {
frame_desc = &common->rx_data_pkt[index];
actual_length = *(u16 *)&frame_desc[0];
@@ -131,7 +130,7 @@ int rsi_read_pkt(struct rsi_common *common, s32 rcv_pkt_len)
(frame_desc + offset),
length,
extended_desc);
- if (skb == NULL)
+ if (!skb)
goto fail;
rsi_indicate_pkt_to_os(common, skb);
@@ -198,15 +197,14 @@ struct rsi_hw *rsi_91x_init(void)
return NULL;
adapter->priv = kzalloc(sizeof(*common), GFP_KERNEL);
- if (adapter->priv == NULL) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of memory\n",
+ if (!adapter->priv) {
+ rsi_dbg(ERR_ZONE, "%s: Failed in allocation of priv\n",
__func__);
kfree(adapter);
return NULL;
- } else {
- common = adapter->priv;
- common->priv = adapter;
}
+ common = adapter->priv;
+ common->priv = adapter;
for (ii = 0; ii < NUM_SOFT_QUEUES; ii++)
skb_queue_head_init(&common->tx_queue[ii]);
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
index 35c14cc..db96bd7 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c
@@ -255,9 +255,9 @@ static int rsi_send_internal_mgmt_frame(struct rsi_common *common,
{
struct skb_info *tx_params;
- if (skb == NULL) {
+ if (!skb) {
rsi_dbg(ERR_ZONE, "%s: Unable to allocate skb\n", __func__);
- return -ENOMEM;
+ return -EINVAL;
}
tx_params = (struct skb_info *)&IEEE80211_SKB_CB(skb)->driver_data;
tx_params->flags |= INTERNAL_MGMT_PKT;
@@ -290,12 +290,8 @@ static int rsi_load_radio_caps(struct rsi_common *common)
rsi_dbg(INFO_ZONE, "%s: Sending rate symbol req frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_radio_caps));
-
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, sizeof(struct rsi_radio_caps));
radio_caps = (struct rsi_radio_caps *)skb->data;
@@ -375,8 +371,8 @@ static int rsi_load_radio_caps(struct rsi_common *common)
* rsi_mgmt_pkt_to_core() - This function is the entry point for Mgmt module.
* @common: Pointer to the driver private structure.
* @msg: Pointer to received packet.
- * @msg_len: Length of the recieved packet.
- * @type: Type of recieved packet.
+ * @msg_len: Length of the received packet.
+ * @type: Type of received packet.
*
* Return: 0 on success, -1 on failure.
*/
@@ -406,11 +402,8 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
}
skb = dev_alloc_skb(msg_len);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed to allocate skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
buffer = skb_put(skb, msg_len);
@@ -425,9 +418,8 @@ static int rsi_mgmt_pkt_to_core(struct rsi_common *common,
rx_params->rssi = rsi_get_rssi(msg);
rx_params->channel = rsi_get_channel(msg);
rsi_indicate_pkt_to_os(common, skb);
- } else {
+ } else
rsi_dbg(MGMT_TX_ZONE, "%s: Internal Packet\n", __func__);
- }
return 0;
}
@@ -459,12 +451,8 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
rsi_dbg(MGMT_TX_ZONE, "%s: Sending sta notify frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_peer_notify));
-
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, sizeof(struct rsi_peer_notify));
peer_notify = (struct rsi_peer_notify *)skb->data;
@@ -505,7 +493,7 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
}
/**
- * rsi_send_aggregation_params_frame() - This function sends the ampdu
+ * rsi_send_aggr_params_frame() - This function sends the ampdu
* indication frame to firmware.
* @common: Pointer to the driver private structure.
* @tid: traffic identifier.
@@ -515,28 +503,26 @@ static int rsi_hal_send_sta_notify_frame(struct rsi_common *common,
*
* Return: 0 on success, corresponding negative error code on failure.
*/
-int rsi_send_aggregation_params_frame(struct rsi_common *common,
- u16 tid,
- u16 ssn,
- u8 buf_size,
- u8 event)
+int rsi_send_aggr_params_frame(struct rsi_common *common,
+ u16 tid,
+ u16 ssn,
+ u8 buf_size,
+ u8 event)
{
struct sk_buff *skb = NULL;
struct rsi_mac_frame *mgmt_frame;
u8 peer_id = 0;
skb = dev_alloc_skb(FRAME_DESC_SZ);
-
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
- rsi_dbg(MGMT_TX_ZONE, "%s: Sending AMPDU indication frame\n", __func__);
+ rsi_dbg(MGMT_TX_ZONE,
+ "%s: Sending AMPDU indication frame\n",
+ __func__);
mgmt_frame->desc_word[0] = cpu_to_le16(RSI_WIFI_MGMT_Q << 12);
mgmt_frame->desc_word[1] = cpu_to_le16(AMPDU_IND);
@@ -545,7 +531,9 @@ int rsi_send_aggregation_params_frame(struct rsi_common *common,
mgmt_frame->desc_word[4] = cpu_to_le16(ssn);
mgmt_frame->desc_word[5] = cpu_to_le16(buf_size);
mgmt_frame->desc_word[7] =
- cpu_to_le16((tid | (START_AMPDU_AGGR << 4) | (peer_id << 8)));
+ cpu_to_le16((tid |
+ (START_AMPDU_AGGR << 4) |
+ (peer_id << 8)));
} else if (event == STA_RX_ADDBA_DONE) {
mgmt_frame->desc_word[4] = cpu_to_le16(ssn);
mgmt_frame->desc_word[7] = cpu_to_le16(tid |
@@ -583,11 +571,8 @@ static int rsi_program_bb_rf(struct rsi_common *common)
rsi_dbg(MGMT_TX_ZONE, "%s: Sending program BB/RF frame\n", __func__);
skb = dev_alloc_skb(FRAME_DESC_SZ);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
@@ -605,6 +590,7 @@ static int rsi_program_bb_rf(struct rsi_common *common)
common->bb_rf_prog_count = 1;
mgmt_frame->desc_word[7] |= cpu_to_le16(PUT_BBP_RESET |
BBP_REG_WRITE | (RSI_RF_TYPE << 4));
+
skb_put(skb, FRAME_DESC_SZ);
return rsi_send_internal_mgmt_frame(common, skb);
@@ -617,7 +603,8 @@ static int rsi_program_bb_rf(struct rsi_common *common)
*
* Return: 0 on success, corresponding negative error code on failure.
*/
-int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
+int rsi_set_vap_capabilities(struct rsi_common *common,
+ enum opmode mode)
{
struct sk_buff *skb = NULL;
struct rsi_vap_caps *vap_caps;
@@ -626,14 +613,12 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode)
struct ieee80211_conf *conf = &hw->conf;
u16 vap_id = 0;
- rsi_dbg(MGMT_TX_ZONE, "%s: Sending VAP capabilities frame\n", __func__);
+ rsi_dbg(MGMT_TX_ZONE,
+ "%s: Sending VAP capabilities frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_vap_caps));
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, sizeof(struct rsi_vap_caps));
vap_caps = (struct rsi_vap_caps *)skb->data;
@@ -705,11 +690,8 @@ int rsi_hal_load_key(struct rsi_common *common,
rsi_dbg(MGMT_TX_ZONE, "%s: Sending load key frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_set_key));
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, sizeof(struct rsi_set_key));
set_key = (struct rsi_set_key *)skb->data;
@@ -736,13 +718,10 @@ int rsi_hal_load_key(struct rsi_common *common,
set_key->desc_word[4] = cpu_to_le16(key_descriptor);
if ((cipher == WLAN_CIPHER_SUITE_WEP40) ||
- (cipher == WLAN_CIPHER_SUITE_WEP104)) {
- memcpy(&set_key->key[key_id][1],
- data,
- key_len * 2);
- } else {
+ (cipher == WLAN_CIPHER_SUITE_WEP104))
+ memcpy(&set_key->key[key_id][1], data, key_len * 2);
+ else
memcpy(&set_key->key[0][0], data, key_len);
- }
memcpy(set_key->tx_mic_key, &data[16], 8);
memcpy(set_key->rx_mic_key, &data[24], 8);
@@ -765,11 +744,8 @@ static int rsi_load_bootup_params(struct rsi_common *common)
rsi_dbg(MGMT_TX_ZONE, "%s: Sending boot params frame\n", __func__);
skb = dev_alloc_skb(sizeof(struct rsi_boot_params));
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, sizeof(struct rsi_boot_params));
boot_params = (struct rsi_boot_params *)skb->data;
@@ -780,7 +756,8 @@ static int rsi_load_bootup_params(struct rsi_common *common)
memcpy(&boot_params->bootup_params,
&boot_params_40,
sizeof(struct bootup_params));
- rsi_dbg(MGMT_TX_ZONE, "%s: Packet 40MHZ <=== %d\n", __func__,
+ rsi_dbg(MGMT_TX_ZONE,
+ "%s: Packet 40MHZ <=== %d\n", __func__,
UMAC_CLK_40BW);
boot_params->desc_word[7] = cpu_to_le16(UMAC_CLK_40BW);
} else {
@@ -828,11 +805,8 @@ static int rsi_send_reset_mac(struct rsi_common *common)
rsi_dbg(MGMT_TX_ZONE, "%s: Sending reset MAC frame\n", __func__);
skb = dev_alloc_skb(FRAME_DESC_SZ);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
@@ -919,11 +893,8 @@ int rsi_set_channel(struct rsi_common *common, u16 channel)
"%s: Sending scan req frame\n", __func__);
skb = dev_alloc_skb(FRAME_DESC_SZ);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
@@ -980,6 +951,7 @@ static int rsi_compare(const void *a, const void *b)
static bool rsi_map_rates(u16 rate, int *offset)
{
int kk;
+
for (kk = 0; kk < ARRAY_SIZE(rsi_mcsrates); kk++) {
if (rate == mcs[kk]) {
*offset = kk;
@@ -1013,20 +985,14 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)
u8 num_supported_rates = 0;
u8 rate_table_offset, rate_offset = 0;
u32 rate_bitmap = common->bitrate_mask[band];
-
u16 *selected_rates, min_rate;
skb = dev_alloc_skb(sizeof(struct rsi_auto_rate));
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
selected_rates = kzalloc(2 * RSI_TBL_SZ, GFP_KERNEL);
if (!selected_rates) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of mem\n",
- __func__);
dev_kfree_skb(skb);
return -ENOMEM;
}
@@ -1140,14 +1106,17 @@ void rsi_inform_bss_status(struct rsi_common *common,
u16 aid)
{
if (status) {
+ common->hw_data_qs_blocked = true;
rsi_hal_send_sta_notify_frame(common,
RSI_IFTYPE_STATION,
STA_CONNECTED,
bssid,
qos_enable,
aid);
- if (common->min_rate == 0xffff)
+ if (common->min_rate == 0xffff) {
+ rsi_dbg(INFO_ZONE, "Send auto rate request\n");
rsi_send_auto_rate_request(common);
+ }
} else {
rsi_hal_send_sta_notify_frame(common,
RSI_IFTYPE_STATION,
@@ -1170,14 +1139,12 @@ static int rsi_eeprom_read(struct rsi_common *common)
struct rsi_mac_frame *mgmt_frame;
struct sk_buff *skb;
- rsi_dbg(MGMT_TX_ZONE, "%s: Sending EEPROM read req frame\n", __func__);
+ rsi_dbg(MGMT_TX_ZONE,
+ "%s: Sending EEPROM read req frame\n", __func__);
skb = dev_alloc_skb(FRAME_DESC_SZ);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
@@ -1214,11 +1181,8 @@ int rsi_send_block_unblock_frame(struct rsi_common *common, bool block_event)
rsi_dbg(MGMT_TX_ZONE, "%s: Sending block/unblock frame\n", __func__);
skb = dev_alloc_skb(FRAME_DESC_SZ);
- if (!skb) {
- rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
- __func__);
+ if (!skb)
return -ENOMEM;
- }
memset(skb->data, 0, FRAME_DESC_SZ);
mgmt_frame = (struct rsi_mac_frame *)skb->data;
@@ -1261,9 +1225,8 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
if (rsi_eeprom_read(common)) {
common->fsm_state = FSM_CARD_NOT_READY;
goto out;
- } else {
+ } else
common->fsm_state = FSM_EEPROM_READ_MAC_ADDR;
- }
} else {
rsi_dbg(INFO_ZONE,
"%s: Received bootup params cfm in %d state\n",
@@ -1273,6 +1236,9 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
break;
case EEPROM_READ_TYPE:
+ rsi_dbg(FSM_ZONE,
+ "%s: EEPROM READ confirm received\n",
+ __func__);
if (common->fsm_state == FSM_EEPROM_READ_MAC_ADDR) {
if (msg[16] == MAGIC_WORD) {
u8 offset = (FRAME_DESC_SZ + WLAN_HOST_MODE_LEN
@@ -1324,7 +1290,8 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
goto out;
} else {
common->fsm_state = FSM_BB_RF_PROG_SENT;
- rsi_dbg(FSM_ZONE, "%s: Radio cap cfm received\n",
+ rsi_dbg(FSM_ZONE,
+ "%s: Radio cap cfm received\n",
__func__);
}
} else {
@@ -1347,27 +1314,29 @@ static int rsi_handle_ta_confirm_type(struct rsi_common *common,
}
} else {
rsi_dbg(INFO_ZONE,
- "%s: Received bbb_rf cfm in %d state\n",
+ "%s: Received bb_rf cfm in %d state\n",
__func__, common->fsm_state);
return 0;
}
break;
default:
- rsi_dbg(INFO_ZONE, "%s: Invalid TA confirm pkt received\n",
+ rsi_dbg(INFO_ZONE,
+ "%s: Invalid TA confirm pkt received\n",
__func__);
break;
}
return 0;
out:
- rsi_dbg(ERR_ZONE, "%s: Unable to send pkt/Invalid frame received\n",
+ rsi_dbg(ERR_ZONE,
+ "%s: Unable to send pkt/Invalid frame received\n",
__func__);
return -EINVAL;
}
/**
* rsi_mgmt_pkt_recv() - This function processes the management packets
- * recieved from the hardware.
+ * received from the hardware.
* @common: Pointer to the driver private structure.
* @msg: Pointer to the received packet.
*
@@ -1376,7 +1345,7 @@ out:
int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
{
s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff);
- u16 msg_type = (msg[2]);
+ u16 msg_type = msg[2];
int ret;
rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n",
@@ -1404,8 +1373,8 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg)
rsi_dbg(FSM_ZONE, "%s: Probe confirm received\n",
__func__);
}
- } else {
+ } else
return rsi_mgmt_pkt_to_core(common, msg, msg_len, msg_type);
- }
+
return 0;
}
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c
index 8428858..331865b 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c
@@ -1,6 +1,8 @@
/**
* Copyright (c) 2014 Redpine Signals Inc.
*
+ * Developers:
+ * Fariya Fathima 2014 <fariya.f@redpinesignals.com>
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@@ -128,7 +130,7 @@ static int rsi_issue_sdiocommand(struct sdio_func *func,
}
/**
- * rsi_handle_interrupt() - This function is called upon the occurence
+ * rsi_handle_interrupt() - This function is called upon the occurrence
* of an interrupt.
* @function: Pointer to the sdio_func structure.
*
@@ -183,7 +185,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
host->ios.timing = MMC_TIMING_LEGACY;
host->ops->set_ios(host, &host->ios);
- /*
+ /**
* This delay should be sufficient to allow the power supply
* to reach the minimum voltage.
*/
@@ -193,7 +195,7 @@ static void rsi_reset_card(struct sdio_func *pfunction)
host->ios.power_mode = MMC_POWER_ON;
host->ops->set_ios(host, &host->ios);
- /*
+ /**
* This delay must be at least 74 clock sizes, or 1 ms, or the
* time required to reach a stable voltage.
*/
@@ -361,6 +363,7 @@ static int rsi_setblocklength(struct rsi_hw *adapter, u32 length)
struct rsi_91x_sdiodev *dev =
(struct rsi_91x_sdiodev *)adapter->rsi_dev;
int status;
+
rsi_dbg(INIT_ZONE, "%s: Setting the block length\n", __func__);
status = sdio_set_block_size(dev->pfunction, length);
@@ -464,6 +467,7 @@ int rsi_sdio_write_register(struct rsi_hw *adapter,
void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit)
{
int status;
+
status = rsi_sdio_write_register(adapter,
1,
(SDIO_FUN1_INTR_CLR_REG |
@@ -473,8 +477,6 @@ void rsi_sdio_ack_intr(struct rsi_hw *adapter, u8 int_bit)
rsi_dbg(ERR_ZONE, "%s: unable to send ack\n", __func__);
}
-
-
/**
* rsi_sdio_read_register_multiple() - This function read multiple bytes of
* information from the SD card.
@@ -667,7 +669,7 @@ static int rsi_init_sdio_interface(struct rsi_hw *adapter,
goto fail;
}
- rsi_dbg(INIT_ZONE, "%s: Setup card succesfully\n", __func__);
+ rsi_dbg(INIT_ZONE, "%s: Setup card successfully\n", __func__);
status = rsi_init_sdio_slave_regs(adapter);
if (status) {
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
index 40d7231..ae42391 100644
--- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
+++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c
@@ -252,11 +252,8 @@ static int rsi_process_pkt(struct rsi_common *common)
rcv_pkt_len = (num_blks * 256);
common->rx_data_pkt = kmalloc(rcv_pkt_len, GFP_KERNEL);
- if (!common->rx_data_pkt) {
- rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n",
- __func__);
+ if (!common->rx_data_pkt)
return -ENOMEM;
- }
status = rsi_sdio_host_intf_read_pkt(adapter,
common->rx_data_pkt,
@@ -426,8 +423,8 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
"%s: ==> FIRMWARE Assert <==\n",
__func__);
status = rsi_sdio_read_register(common->priv,
- SDIO_FW_STATUS_REG,
- &fw_status);
+ SDIO_FW_STATUS_REG,
+ &fw_status);
if (status) {
rsi_dbg(ERR_ZONE,
"%s: Failed to read f/w reg\n",
@@ -435,7 +432,7 @@ void rsi_interrupt_handler(struct rsi_hw *adapter)
} else {
rsi_dbg(ERR_ZONE,
"%s: Firmware Status is 0x%x\n",
- __func__ , fw_status);
+ __func__, fw_status);
rsi_sdio_ack_intr(common->priv,
(1 << FW_ASSERT_IND));
}
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c
index ef5d394..2b322e5 100644
--- a/drivers/net/wireless/rsi/rsi_91x_usb.c
+++ b/drivers/net/wireless/rsi/rsi_91x_usb.c
@@ -1,6 +1,9 @@
/**
* Copyright (c) 2014 Redpine Signals Inc.
*
+ * Developers:
+ * Prameela Rani Garnepudi 2016 <prameela.garnepudi@redpinesignals.com>
+ *
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
@@ -43,7 +46,6 @@ static int rsi_usb_card_write(struct rsi_hw *adapter,
len,
&transfer,
HZ * 5);
-
if (status < 0) {
rsi_dbg(ERR_ZONE,
"Card write failed with error code :%10d\n", status);
@@ -275,11 +277,11 @@ static int rsi_rx_urb_submit(struct rsi_hw *adapter)
/**
* rsi_usb_write_register_multiple() - This function writes multiple bytes of
- * information to multiple registers.
- * @adapter: Pointer to the adapter structure.
- * @addr: Address of the register.
- * @data: Pointer to the data that has to be written.
- * @count: Number of multiple bytes to be written on to the registers.
+ * information to the given address.
+ * @adapter: Pointer to the adapter structure.
+ * @addr: Address of the register.
+ * @data: Pointer to the data that has to be written.
+ * @count: Number of multiple bytes to be written on to the registers.
*
* Return: status: 0 on success, a negative error code on failure.
*/
@@ -392,11 +394,8 @@ static int rsi_init_usb_interface(struct rsi_hw *adapter,
usb_set_intfdata(pfunction, adapter);
common->rx_data_pkt = kmalloc(2048, GFP_KERNEL);
- if (!common->rx_data_pkt) {
- rsi_dbg(ERR_ZONE, "%s: Failed to allocate memory\n",
- __func__);
+ if (!common->rx_data_pkt)
return -ENOMEM;
- }
rsi_dev->tx_buffer = kmalloc(2048, GFP_KERNEL);
if (!rsi_dev->tx_buffer) {
@@ -568,7 +567,20 @@ static struct usb_driver rsi_driver = {
#endif
};
-module_usb_driver(rsi_driver);
+static int __init rsi_usb_module_init(void)
+{
+ rsi_dbg(INIT_ZONE,
+ "=====> RSI USB Module Initialize <=====\n");
+ return usb_register(&rsi_driver);
+}
+
+static void __exit rsi_usb_module_exit(void)
+{
+ usb_deregister(&rsi_driver);
+}
+
+module_init(rsi_usb_module_init);
+module_exit(rsi_usb_module_exit);
MODULE_AUTHOR("Redpine Signals Inc");
MODULE_DESCRIPTION("Common USB layer for RSI drivers");
diff --git a/drivers/net/wireless/rsi/rsi_common.h b/drivers/net/wireless/rsi/rsi_common.h
index d3fbe33..ad1be13 100644
--- a/drivers/net/wireless/rsi/rsi_common.h
+++ b/drivers/net/wireless/rsi/rsi_common.h
@@ -38,7 +38,7 @@ static inline int rsi_wait_event(struct rsi_event *event, u32 timeout)
if (!timeout)
status = wait_event_interruptible(event->event_queue,
- (atomic_read(&event->event_condition) == 0));
+ (!atomic_read(&event->event_condition)));
else
status = wait_event_interruptible_timeout(event->event_queue,
(atomic_read(&event->event_condition) == 0),
diff --git a/drivers/net/wireless/rsi/rsi_debugfs.h b/drivers/net/wireless/rsi/rsi_debugfs.h
index 580ad3b..8b64944 100644
--- a/drivers/net/wireless/rsi/rsi_debugfs.h
+++ b/drivers/net/wireless/rsi/rsi_debugfs.h
@@ -23,12 +23,10 @@
#ifndef CONFIG_RSI_DEBUGFS
static inline int rsi_init_dbgfs(struct rsi_hw *adapter)
{
- return 0;
}
static inline void rsi_remove_dbgfs(struct rsi_hw *adapter)
{
- return;
}
#else
struct rsi_dbg_files {
@@ -42,6 +40,7 @@ struct rsi_debugfs {
struct rsi_dbg_ops *dfs_get_ops;
struct dentry *rsi_files[MAX_DEBUGFS_ENTRIES];
};
+
int rsi_init_dbgfs(struct rsi_hw *adapter);
void rsi_remove_dbgfs(struct rsi_hw *adapter);
#endif
diff --git a/drivers/net/wireless/rsi/rsi_main.h b/drivers/net/wireless/rsi/rsi_main.h
index dcd0957..cde1a75 100644
--- a/drivers/net/wireless/rsi/rsi_main.h
+++ b/drivers/net/wireless/rsi/rsi_main.h
@@ -21,23 +21,25 @@
#include <linux/skbuff.h>
#include <net/mac80211.h>
-#define ERR_ZONE BIT(0) /* For Error Msgs */
-#define INFO_ZONE BIT(1) /* For General Status Msgs */
-#define INIT_ZONE BIT(2) /* For Driver Init Seq Msgs */
-#define MGMT_TX_ZONE BIT(3) /* For TX Mgmt Path Msgs */
-#define MGMT_RX_ZONE BIT(4) /* For RX Mgmt Path Msgs */
-#define DATA_TX_ZONE BIT(5) /* For TX Data Path Msgs */
-#define DATA_RX_ZONE BIT(6) /* For RX Data Path Msgs */
-#define FSM_ZONE BIT(7) /* For State Machine Msgs */
-#define ISR_ZONE BIT(8) /* For Interrupt Msgs */
+#define ERR_ZONE BIT(0) /* Error Msgs */
+#define INFO_ZONE BIT(1) /* General Debug Msgs */
+#define INIT_ZONE BIT(2) /* Driver Init Msgs */
+#define MGMT_TX_ZONE BIT(3) /* TX Mgmt Path Msgs */
+#define MGMT_RX_ZONE BIT(4) /* RX Mgmt Path Msgs */
+#define DATA_TX_ZONE BIT(5) /* TX Data Path Msgs */
+#define DATA_RX_ZONE BIT(6) /* RX Data Path Msgs */
+#define FSM_ZONE BIT(7) /* State Machine Msgs */
+#define ISR_ZONE BIT(8) /* Interrupt Msgs */
#define FSM_CARD_NOT_READY 0
-#define FSM_BOOT_PARAMS_SENT 1
-#define FSM_EEPROM_READ_MAC_ADDR 2
-#define FSM_RESET_MAC_SENT 3
-#define FSM_RADIO_CAPS_SENT 4
-#define FSM_BB_RF_PROG_SENT 5
-#define FSM_MAC_INIT_DONE 6
+#define FSM_COMMON_DEV_PARAMS_SENT 1
+#define FSM_BOOT_PARAMS_SENT 2
+#define FSM_EEPROM_READ_MAC_ADDR 3
+#define FSM_EEPROM_READ_RF_TYPE 4
+#define FSM_RESET_MAC_SENT 5
+#define FSM_RADIO_CAPS_SENT 6
+#define FSM_BB_RF_PROG_SENT 7
+#define FSM_MAC_INIT_DONE 8
extern u32 rsi_zone_enabled;
extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...);
@@ -206,12 +208,14 @@ struct rsi_common {
bool hw_data_qs_blocked;
};
+#define IEEE80211_NUM_BANDS 2
+
struct rsi_hw {
struct rsi_common *priv;
struct ieee80211_hw *hw;
struct ieee80211_vif *vifs[RSI_MAX_VIFS];
struct ieee80211_tx_queue_params edca_params[NUM_EDCA_QUEUES];
- struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];
+ struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
struct device *device;
u8 sc_nvifs;
diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h
index 3741173..ed3aa83 100644
--- a/drivers/net/wireless/rsi/rsi_mgmt.h
+++ b/drivers/net/wireless/rsi/rsi_mgmt.h
@@ -71,31 +71,31 @@
#define RSI_ENABLE_40MHZ (0x1 << 3)
#define ENABLE_SHORTGI_RATE BIT(9)
-#define RX_BA_INDICATION 1
-#define RSI_TBL_SZ 40
-#define MAX_RETRIES 8
+#define RX_BA_INDICATION 1
+#define RSI_TBL_SZ 40
+#define MAX_RETRIES 8
#define RSI_IFTYPE_STATION 0
-#define STD_RATE_MCS7 0x07
-#define STD_RATE_MCS6 0x06
-#define STD_RATE_MCS5 0x05
-#define STD_RATE_MCS4 0x04
-#define STD_RATE_MCS3 0x03
-#define STD_RATE_MCS2 0x02
-#define STD_RATE_MCS1 0x01
-#define STD_RATE_MCS0 0x00
-#define STD_RATE_54 0x6c
-#define STD_RATE_48 0x60
-#define STD_RATE_36 0x48
-#define STD_RATE_24 0x30
-#define STD_RATE_18 0x24
-#define STD_RATE_12 0x18
-#define STD_RATE_11 0x16
-#define STD_RATE_09 0x12
-#define STD_RATE_06 0x0C
-#define STD_RATE_5_5 0x0B
-#define STD_RATE_02 0x04
-#define STD_RATE_01 0x02
+#define STD_RATE_MCS7 0x07
+#define STD_RATE_MCS6 0x06
+#define STD_RATE_MCS5 0x05
+#define STD_RATE_MCS4 0x04
+#define STD_RATE_MCS3 0x03
+#define STD_RATE_MCS2 0x02
+#define STD_RATE_MCS1 0x01
+#define STD_RATE_MCS0 0x00
+#define STD_RATE_54 0x6c
+#define STD_RATE_48 0x60
+#define STD_RATE_36 0x48
+#define STD_RATE_24 0x30
+#define STD_RATE_18 0x24
+#define STD_RATE_12 0x18
+#define STD_RATE_11 0x16
+#define STD_RATE_09 0x12
+#define STD_RATE_06 0x0C
+#define STD_RATE_5_5 0x0B
+#define STD_RATE_02 0x04
+#define STD_RATE_01 0x02
#define RSI_RF_TYPE 1
#define RSI_RATE_00 0x00
@@ -173,9 +173,9 @@ enum cmd_frame_type {
AUTO_RATE_IND,
BOOTUP_PARAMS_REQUEST,
VAP_CAPABILITIES,
- EEPROM_READ_TYPE ,
+ EEPROM_READ_TYPE,
EEPROM_WRITE,
- GPIO_PIN_CONFIG ,
+ GPIO_PIN_CONFIG,
SET_RX_FILTER,
AMPDU_IND,
STATS_REQUEST_FRAME,
@@ -288,8 +288,8 @@ static inline u8 rsi_get_channel(u8 *addr)
int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);
int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode);
-int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid,
- u16 ssn, u8 buf_size, u8 event);
+int rsi_send_aggr_params_frame(struct rsi_common *common, u16 tid,
+ u16 ssn, u8 buf_size, u8 event);
int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
u8 key_type, u8 key_id, u32 cipher);
int rsi_set_channel(struct rsi_common *common, u16 chno);
diff --git a/drivers/net/wireless/rsi/rsi_sdio.h b/drivers/net/wireless/rsi/rsi_sdio.h
index c7e8f2b..33a657c 100644
--- a/drivers/net/wireless/rsi/rsi_sdio.h
+++ b/drivers/net/wireless/rsi/rsi_sdio.h
@@ -37,17 +37,17 @@ enum sdio_interrupt_type {
};
/* Buffer status register related info */
-#define PKT_BUFF_SEMI_FULL 0
-#define PKT_BUFF_FULL 1
-#define PKT_MGMT_BUFF_FULL 2
-#define MSDU_PKT_PENDING 3
+#define PKT_BUFF_SEMI_FULL 0
+#define PKT_BUFF_FULL 1
+#define PKT_MGMT_BUFF_FULL 2
+#define MSDU_PKT_PENDING 3
/* Interrupt Bit Related Macros */
-#define PKT_BUFF_AVAILABLE 1
-#define FW_ASSERT_IND 2
+#define PKT_BUFF_AVAILABLE 1
+#define FW_ASSERT_IND 2
-#define RSI_DEVICE_BUFFER_STATUS_REGISTER 0xf3
-#define RSI_FN1_INT_REGISTER 0xf9
-#define RSI_SD_REQUEST_MASTER 0x10000
+#define RSI_DEVICE_BUFFER_STATUS_REGISTER 0xf3
+#define RSI_FN1_INT_REGISTER 0xf9
+#define RSI_SD_REQUEST_MASTER 0x10000
/* FOR SD CARD ONLY */
#define SDIO_RX_NUM_BLOCKS_REG 0x000F1
--
2.4.11
^ permalink raw reply related
* Re: [PATCH] cfg80211: cap 20MHz VHT bitrate at MCS 8
From: Pedersen, Thomas @ 2016-09-07 18:20 UTC (permalink / raw)
To: Ben Greear, linux-wireless; +Cc: Johannes Berg
In-Reply-To: <2769a14e-964d-4ec2-9f04-ddd332434b78@candelatech.com>
On 09/06/2016 12:07 PM, Ben Greear wrote:
> On 09/06/2016 12:00 PM, Thomas Pedersen wrote:
>> Some drivers (ath10k) report MCS 9 @ 20MHz, which
>> technically isn't allowed. To get more meaningful value
>> than 0 out of this however, just cap the bitrate for 20MHz
>> to MCS 8.
>
> If it is actually reporting MCS9, why lie about it? Report it up
> the stack as a proper value instead of hiding the issue?
Good point, will send a v2 extrapolating the value to 86.5Mb/s.
--=20
thomas=
^ permalink raw reply
* Re: brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()
From: Kalle Valo @ 2016-09-07 13:44 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: linux-wireless, Arend van Spriel
In-Reply-To: <1473068749-22487-1-git-send-email-arend.vanspriel@broadcom.com>
Arend Van Spriel <arend.vanspriel@broadcom.com> wrote:
> User-space can choose to omit NL80211_ATTR_SSID and only provide raw
> IE TLV data. When doing so it can provide SSID IE with length exceeding
> the allowed size. The driver further processes this IE copying it
> into a local variable without checking the length. Hence stack can be
> corrupted and used as exploit.
>
> Cc: stable@vger.kernel.org # v4.7
> Reported-by: Daxing Guo <freener.gdx@gmail.com>
> Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
> Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
> Reviewed-by: Franky Lin <franky.lin@broadcom.com>
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Thanks, 1 patch applied to wireless-drivers.git:
ded89912156b brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()
--
Sent by pwcli
https://patchwork.kernel.org/patch/9313305/
^ permalink raw reply
* Re: ath9k: bring back direction setting in ath9k_{start_stop}
From: Kalle Valo @ 2016-09-07 13:23 UTC (permalink / raw)
To: Giedrius Statkevi?ius
Cc: kvalo, ath9k-devel, linux-wireless, ath9k-devel, netdev,
linux-kernel, Miaoqing Pan, stable, Giedrius Statkevičius
In-Reply-To: <20160901174702.8645-1-giedrius.statkevicius@gmail.com>
Giedrius Statkevi?ius <giedrius.statkevicius@gmail.com> wrote:
> A regression was introduced in commit id 79d4db1214a ("ath9k: cleanup
> led_pin initial") that broken the WLAN status led on my laptop with
> AR9287 after suspending and resuming.
>
> Steps to reproduce:
> * Suspend (laptop)
> * Resume (laptop)
> * Observe that the WLAN led no longer turns ON/OFF depending on the
> status and is always red
>
> Even though for my case it only needs to be set to OUT in ath9k_start
> but for consistency bring back the IN direction setting as well.
>
> Cc: Miaoqing Pan <miaoqing@codeaurora.org>
> Cc: Kalle Valo <kvalo@qca.qualcomm.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Thanks, 1 patch applied to ath-current branch of ath.git:
e34f2ff40e03 ath9k: bring back direction setting in ath9k_{start_stop}
--
Sent by pwcli
https://patchwork.kernel.org/patch/9309829/
^ permalink raw reply
* Re: ath9k: bring back direction setting in ath9k_{start_stop}
From: Kalle Valo @ 2016-09-07 13:16 UTC (permalink / raw)
To: Giedrius Statkevi?ius
Cc: ath9k-devel, linux-wireless, ath9k-devel, netdev, linux-kernel,
Miaoqing Pan, stable
In-Reply-To: <e61bb634860745818f8c8c99f79f71a0@euamsexm01a.eu.qualcomm.com>
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Giedrius Statkevi?ius <giedrius.statkevicius@gmail.com> wrote:
>> A regression was introduced in commit id 79d4db1214a ("ath9k: cleanup
>> led_pin initial") that broken the WLAN status led on my laptop with
>> AR9287 after suspending and resuming.
>>
>> Steps to reproduce:
>> * Suspend (laptop)
>> * Resume (laptop)
>> * Observe that the WLAN led no longer turns ON/OFF depending on the
>> status and is always red
>>
>> Even though for my case it only needs to be set to OUT in ath9k_start
>> but for consistency bring back the IN direction setting as well.
>>
>> Cc: Miaoqing Pan <miaoqing@codeaurora.org>
>> Cc: Kalle Valo <kvalo@qca.qualcomm.com>
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
>
> Thanks, 1 patch applied to ath-next branch of ath.git:
>
> 088a60926b66 ath9k: bring back direction setting in ath9k_{start_stop}
Oops, I was supposed to apply this to ath-current branch. Please ignore
this. Luckily I didn't push yet so I can easily fix this.
--
Kalle Valo
^ permalink raw reply
* Re: ath9k: bring back direction setting in ath9k_{start_stop}
From: Kalle Valo @ 2016-09-07 13:11 UTC (permalink / raw)
To: Giedrius Statkevi?ius
Cc: kvalo, ath9k-devel, linux-wireless, ath9k-devel, netdev,
linux-kernel, Miaoqing Pan, stable, Giedrius Statkevičius
In-Reply-To: <20160901174702.8645-1-giedrius.statkevicius@gmail.com>
Giedrius Statkevi?ius <giedrius.statkevicius@gmail.com> wrote:
> A regression was introduced in commit id 79d4db1214a ("ath9k: cleanup
> led_pin initial") that broken the WLAN status led on my laptop with
> AR9287 after suspending and resuming.
>
> Steps to reproduce:
> * Suspend (laptop)
> * Resume (laptop)
> * Observe that the WLAN led no longer turns ON/OFF depending on the
> status and is always red
>
> Even though for my case it only needs to be set to OUT in ath9k_start
> but for consistency bring back the IN direction setting as well.
>
> Cc: Miaoqing Pan <miaoqing@codeaurora.org>
> Cc: Kalle Valo <kvalo@qca.qualcomm.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Thanks, 1 patch applied to ath-next branch of ath.git:
088a60926b66 ath9k: bring back direction setting in ath9k_{start_stop}
--
Sent by pwcli
https://patchwork.kernel.org/patch/9309829/
^ permalink raw reply
* Re: [PATCH] rsi: code clean-up
From: Kalle Valo @ 2016-09-07 11:38 UTC (permalink / raw)
To: Julian Calaby
Cc: Prameela Rani Garnepudi, linux-wireless,
שרי שרון,
Emmanuel Grumbach, Nicholas Mc Guire, xypron.glpk,
SF Markus Elfring, johannes.berg@intel.com
In-Reply-To: <CAGRGNgVyybFSqNLvtvXn-OL4dSXCpbYG2xR+cepayEQ6zPowSg@mail.gmail.com>
Julian Calaby <julian.calaby@gmail.com> writes:
> Hi,
>
> On Wed, Sep 7, 2016 at 8:26 PM, Prameela Rani Garnepudi
> <prameela.garnepudi@redpinesignals.com> wrote:
>> From 0c3da95dfac07df5dffb5e00bcd8a38f2f8491c9 Mon Sep 17 00:00:00 2001
>> From: Prameela Rani Garnepudi <prameela.garnepudi@redpinesignals.com>
>> Date: Wed, 7 Sep 2016 15:28:43 +0530
>> Subject: [PATCH] rsi: code clean-up
>
> Describe what the changes are achieving.
>
> You're also still sending this as a HTML email, there are instructions
> on how to configure your email client to send plain text emails here:
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/email-clients.txt
>
> Because you're sending multi-part HTML emails, your emails are being
> rejected by the mailing list.
I recommend to try to use git-send-email to submit patches, it makes
life so much more easier:
https://www.kernel.org/pub/software/scm/git/docs/git-send-email.html
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v4 2/4] wcn36xx: Transition driver to SMD client
From: Kalle Valo @ 2016-09-07 11:35 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Eugene Krasnikov, wcn36xx, linux-wireless, netdev, linux-kernel,
linux-arm-msm, Andy Gross
In-Reply-To: <1473200312-22438-2-git-send-email-bjorn.andersson@linaro.org>
Bjorn Andersson <bjorn.andersson@linaro.org> writes:
> The wcn36xx wifi driver follows the life cycle of the WLAN_CTRL SMD
> channel, as such it should be a SMD client. This patch makes this
> transition, now that we have the necessary frameworks available.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
>
> Changes since v3:
> - Made msg_header const in wcn36xx_smd_rsp_process()
>
> Changes since v2:
> - Correct the call to the new ieee80211_scan_completed()
>
> drivers/net/wireless/ath/wcn36xx/dxe.c | 16 +++---
> drivers/net/wireless/ath/wcn36xx/main.c | 79 ++++++++++++++++++++----------
> drivers/net/wireless/ath/wcn36xx/smd.c | 31 +++++-------
> drivers/net/wireless/ath/wcn36xx/smd.h | 5 ++
> drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 21 +++-----
> 5 files changed, 86 insertions(+), 66 deletions(-)
So I don't actually need to enable COMPILE_TEST anymore? Nice, thanks.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH v4 1/4] soc: qcom: wcnss_ctrl: Stub wcnss_ctrl API
From: Kalle Valo @ 2016-09-07 11:33 UTC (permalink / raw)
To: Andy Gross
Cc: Bjorn Andersson, Eugene Krasnikov, wcn36xx, linux-wireless,
netdev, linux-kernel, linux-arm-msm, Marcel Holtmann
In-Reply-To: <20160907013958.GA6975@hector.attlocal.net>
Andy Gross <andy.gross@linaro.org> writes:
> On Tue, Sep 06, 2016 at 03:18:29PM -0700, Bjorn Andersson wrote:
>> Stub the wcnss_ctrl API to allow compile testing wcnss function drivers.
>>
>> Cc: Marcel Holtmann <marcel@holtmann.org>
>> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
>> ---
>>
>> There are no other pending changes colliding with this, so if Andy is okay with
>> this it could be merged through Kalle's tree - together with the other patches.
>>
>> Marcel, with this applied we can drop the depends on QCOM_SMD from the
>> btqcomsmd driver as well.
>>
>> Changes since v3:
>> - Added this patch to allow compile testing without SMD support after patch 2
>>
>> include/linux/soc/qcom/wcnss_ctrl.h | 13 +++++++++++++
>> 1 file changed, 13 insertions(+)
>>
>
> This is fine.
>
> Acked-by: Andy Gross <andy.gross@linaro.org>
Thanks. I'll then apply this to my ath.git tree and it will go to Linus
via net-next.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] mwifiex: handle edmac vendor command
From: Kalle Valo @ 2016-09-07 11:27 UTC (permalink / raw)
To: Arend Van Spriel; +Cc: Amitkumar Karwar, linux-wireless@vger.kernel.org
In-Reply-To: <2320ad20-164e-12c5-0b01-9612a1d24300@broadcom.com>
Arend Van Spriel <arend.vanspriel@broadcom.com> writes:
> On 1-9-2016 16:53, Kalle Valo wrote:
>
>> Sorry for the delay. I have been thinking about vendor commands quite a
>> lot and I don't think they belong to upstream drivers. For regular use
>> cases (used by normal users) we have nl80211, for developer and testing
>> purposes we have debugfs and for manufacturing type of tests we have
>> nl80211 testmode interface. The focus of development should be adding
>> new functionality to nl80211 (and other generic interfaces), not to
>> driver specific vendor commands.
>>
>> I know brcm80211 and ti's wlcore have few vendor commands but I'm hoping
>> to remove them sometime soon.
>>
>> Thoughts?
>
> Grabbing the original commit message for vendor commands:
>
> commit ad7e718c9b4f717823fd920a0103f7b0fb06183f
> Author: Johannes Berg <johannes.berg@intel.com>
> Date: Wed Nov 13 13:37:47 2013 +0100
>
> nl80211: vendor command support
>
> Add support for vendor-specific commands to nl80211. This is
> intended to be used for really vendor-specific functionality
> that can't be implemented in a generic fashion for any reason.
> It's *NOT* intended to be used for any normal/generic feature
> or any optimisations that could be implemented across drivers.
>
> I agree that the effort needs to be made to come up with a solution that
> is usable by (most of) all drivers in the upstream wireless subsystem.
>
> The thing with the test mode is that you need to enable it in Kconfig.
And that's on purpose. We did not want testmode to be enabled on distro
kernels, for example.
> We have 1 vendor command in brcmfmac and it used to be under testmode
> api. However, because of the Kconfig thing it would mean we need a
> different kernel to do manufacturing testing. Especially when the
> modules are built-in. The OEMs typically don't like that as they want to
> do the testing using the same kernel as what ends up in the product.
> This was our motivation to use the vendor command when that was added.
Is there a specific reason why you can't keep the testmode always
enabled? Then you would have the same kernel both in manufacturing and
in "normal mode".
> It does have a nasty side-effect that some will see it as a drop-in
> replacement of the driver private ioctl-s. To some extent (as mentioned
> in the commit message above) that should be fine, but we need to make a
> good effort to move things to nl80211.
Sorry, but I'm way too cynical to buy that :) A "good effort" means that
in most of cases it will never happen. Once the vendor command is
accepted into upsteam trees the developer will lose any interest on
trying to make it a generic interface. That's just how humans work,
including me.
I do see your and Amitkumar's point how much easier the vendor commands
make it to implement new driver features and part of me also wants that.
I just think that in the long run that's detrimental for Linux wireless
and we end up into having multiple drivers having same features enabled
via different vendor commands.
--
Kalle Valo
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox