* [PATCH 2/4] staging: wilc1000: remove unused compile time featurization
2019-11-22 20:52 [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Adham.Abozaeid
@ 2019-11-22 20:52 ` Adham.Abozaeid
2019-11-22 20:52 ` [PATCH 3/4] staging: wilc1000: use kernel provided struct cast to extract mac header Adham.Abozaeid
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Adham.Abozaeid @ 2019-11-22 20:52 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat
From: Ajay Singh <ajay.kathat@microchip.com>
Removed the unused compile type featurization. It's not recommended to
have compile type feature. Currently removing these defines as they are
not used. If any of these parameters are needed later should be added
using run time feature.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/wlan.c | 23 -----------------------
1 file changed, 23 deletions(-)
diff --git a/drivers/staging/wilc1000/wlan.c b/drivers/staging/wilc1000/wlan.c
index d3de76126b78..ba5446724c93 100644
--- a/drivers/staging/wilc1000/wlan.c
+++ b/drivers/staging/wilc1000/wlan.c
@@ -890,29 +890,6 @@ int wilc_wlan_start(struct wilc *wilc)
if (wilc->io_type == WILC_HIF_SDIO && wilc->dev_irq_num)
reg |= WILC_HAVE_SDIO_IRQ_GPIO;
-#ifdef WILC_DISABLE_PMU
-#else
- reg |= WILC_HAVE_USE_PMU;
-#endif
-
-#ifdef WILC_SLEEP_CLK_SRC_XO
- reg |= WILC_HAVE_SLEEP_CLK_SRC_XO;
-#elif defined WILC_SLEEP_CLK_SRC_RTC
- reg |= WILC_HAVE_SLEEP_CLK_SRC_RTC;
-#endif
-
-#ifdef WILC_EXT_PA_INV_TX_RX
- reg |= WILC_HAVE_EXT_PA_INV_TX_RX;
-#endif
- reg |= WILC_HAVE_USE_IRQ_AS_HOST_WAKE;
- reg |= WILC_HAVE_LEGACY_RF_SETTINGS;
-#ifdef XTAL_24
- reg |= WILC_HAVE_XTAL_24;
-#endif
-#ifdef DISABLE_WILC_UART
- reg |= WILC_HAVE_DISABLE_WILC_UART;
-#endif
-
ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg);
if (!ret) {
release_bus(wilc, WILC_BUS_RELEASE_ONLY);
--
2.24.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] staging: wilc1000: use kernel provided struct cast to extract mac header
2019-11-22 20:52 [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Adham.Abozaeid
2019-11-22 20:52 ` [PATCH 2/4] staging: wilc1000: remove unused compile time featurization Adham.Abozaeid
@ 2019-11-22 20:52 ` Adham.Abozaeid
2019-11-22 20:52 ` [PATCH 4/4] staging: wilc1000: use GENMASK to extract wid type Adham.Abozaeid
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Adham.Abozaeid @ 2019-11-22 20:52 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat
From: Ajay Singh <ajay.kathat@microchip.com>
To parse the mac header make use of *struct ieee80211_hdr* instead of
extracting individual fields separately using pointer operation.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/netdev.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c
index d2c0b0f7cf63..3fd8e008f733 100644
--- a/drivers/staging/wilc1000/netdev.c
+++ b/drivers/staging/wilc1000/netdev.c
@@ -96,21 +96,18 @@ void wilc_mac_indicate(struct wilc *wilc)
static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
{
- u8 *bssid, *bssid1;
struct net_device *ndev = NULL;
struct wilc_vif *vif;
-
- bssid = mac_header + 10;
- bssid1 = mac_header + 4;
+ struct ieee80211_hdr *h = (struct ieee80211_hdr *)mac_header;
list_for_each_entry_rcu(vif, &wilc->vif_list, list) {
if (vif->mode == WILC_STATION_MODE)
- if (ether_addr_equal_unaligned(bssid, vif->bssid)) {
+ if (ether_addr_equal_unaligned(h->addr2, vif->bssid)) {
ndev = vif->ndev;
goto out;
}
if (vif->mode == WILC_AP_MODE)
- if (ether_addr_equal_unaligned(bssid1, vif->bssid)) {
+ if (ether_addr_equal_unaligned(h->addr1, vif->bssid)) {
ndev = vif->ndev;
goto out;
}
--
2.24.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] staging: wilc1000: use GENMASK to extract wid type
2019-11-22 20:52 [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Adham.Abozaeid
2019-11-22 20:52 ` [PATCH 2/4] staging: wilc1000: remove unused compile time featurization Adham.Abozaeid
2019-11-22 20:52 ` [PATCH 3/4] staging: wilc1000: use kernel provided struct cast to extract mac header Adham.Abozaeid
@ 2019-11-22 20:52 ` Adham.Abozaeid
2019-11-25 6:54 ` [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Dan Carpenter
2019-11-25 9:26 ` Julian Calaby
4 siblings, 0 replies; 8+ messages in thread
From: Adham.Abozaeid @ 2019-11-22 20:52 UTC (permalink / raw)
To: linux-wireless; +Cc: devel, gregkh, johannes, Ajay.Kathat
From: Ajay Singh <ajay.kathat@microchip.com>
Refactor code by make use of 'GENMASK' to extract the WID type from
buffer received from firmware.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/wlan.h | 1 +
drivers/staging/wilc1000/wlan_cfg.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/wlan.h b/drivers/staging/wilc1000/wlan.h
index 1f6957cf2e9c..44ae6ed6882c 100644
--- a/drivers/staging/wilc1000/wlan.h
+++ b/drivers/staging/wilc1000/wlan.h
@@ -197,6 +197,7 @@
#define IS_MANAGMEMENT_CALLBACK 0x080
#define IS_MGMT_STATUS_SUCCES 0x040
+#define WILC_WID_TYPE GENMASK(15, 12)
/********************************************
*
* Tx/Rx Queue Structure
diff --git a/drivers/staging/wilc1000/wlan_cfg.c b/drivers/staging/wilc1000/wlan_cfg.c
index 6f6b286788d1..2538435b82fd 100644
--- a/drivers/staging/wilc1000/wlan_cfg.c
+++ b/drivers/staging/wilc1000/wlan_cfg.c
@@ -4,6 +4,7 @@
* All rights reserved.
*/
+#include <linux/bitfield.h>
#include "wlan_if.h"
#include "wlan.h"
#include "wlan_cfg.h"
@@ -132,7 +133,6 @@ static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size)
*
********************************************/
-#define GET_WID_TYPE(wid) (((wid) >> 12) & 0x7)
static void wilc_wlan_parse_response_frame(struct wilc *wl, u8 *info, int size)
{
u16 wid;
@@ -142,7 +142,7 @@ static void wilc_wlan_parse_response_frame(struct wilc *wl, u8 *info, int size)
i = 0;
wid = get_unaligned_le16(info);
- switch (GET_WID_TYPE(wid)) {
+ switch (FIELD_GET(WILC_WID_TYPE, wid)) {
case WID_CHAR:
do {
if (wl->cfg.b[i].id == WID_NIL)
@@ -244,7 +244,7 @@ static void wilc_wlan_parse_info_frame(struct wilc *wl, u8 *info)
int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, u8 *buf, int size)
{
- u8 type = (id >> 12) & 0xf;
+ u8 type = FIELD_GET(WILC_WID_TYPE, id);
int ret = 0;
switch (type) {
@@ -290,7 +290,7 @@ int wilc_wlan_cfg_get_wid(u8 *frame, u32 offset, u16 id)
int wilc_wlan_cfg_get_val(struct wilc *wl, u16 wid, u8 *buffer,
u32 buffer_size)
{
- u32 type = (wid >> 12) & 0xf;
+ u8 type = FIELD_GET(WILC_WID_TYPE, wid);
int i, ret = 0;
i = 0;
--
2.24.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt
2019-11-22 20:52 [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Adham.Abozaeid
` (2 preceding siblings ...)
2019-11-22 20:52 ` [PATCH 4/4] staging: wilc1000: use GENMASK to extract wid type Adham.Abozaeid
@ 2019-11-25 6:54 ` Dan Carpenter
2019-11-25 9:26 ` Julian Calaby
4 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2019-11-25 6:54 UTC (permalink / raw)
To: Adham.Abozaeid; +Cc: linux-wireless, devel, gregkh, johannes, Ajay.Kathat
On Fri, Nov 22, 2019 at 08:52:02PM +0000, Adham.Abozaeid@microchip.com wrote:
> From: Ajay Singh <ajay.kathat@microchip.com>
>
> Set SDIO Out-of-band interrupt configuration at run time by passing
> parameter during module load.
>
This is barely an improvement at all... Why not just make it auto
detect?
regards,
dan carpenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt
2019-11-22 20:52 [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Adham.Abozaeid
` (3 preceding siblings ...)
2019-11-25 6:54 ` [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt Dan Carpenter
@ 2019-11-25 9:26 ` Julian Calaby
2019-12-03 19:10 ` Adham.Abozaeid
4 siblings, 1 reply; 8+ messages in thread
From: Julian Calaby @ 2019-11-25 9:26 UTC (permalink / raw)
To: Adham Abozaeid; +Cc: linux-wireless, devel, Greg KH, Johannes Berg, Ajay Singh
Hi Adham,
On Sat, Nov 23, 2019 at 7:55 AM <Adham.Abozaeid@microchip.com> wrote:
>
> From: Ajay Singh <ajay.kathat@microchip.com>
>
> Set SDIO Out-of-band interrupt configuration at run time by passing
> parameter during module load.
The OOB interrupt is a GPIO and this is an SDIO card, so why not just
set the relevant pin in the devicetree and detect it based on that?
I'm pretty sure that the Broadcom fmac driver does something like this.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt
2019-11-25 9:26 ` Julian Calaby
@ 2019-12-03 19:10 ` Adham.Abozaeid
2019-12-10 9:27 ` Greg KH
0 siblings, 1 reply; 8+ messages in thread
From: Adham.Abozaeid @ 2019-12-03 19:10 UTC (permalink / raw)
To: julian.calaby; +Cc: linux-wireless, devel, gregkh, johannes, Ajay.Kathat
On 11/25/19 2:26 AM, Julian Calaby wrote:
> Hi Adham,
>
> The OOB interrupt is a GPIO and this is an SDIO card, so why not just
> set the relevant pin in the devicetree and detect it based on that?
>
> I'm pretty sure that the Broadcom fmac driver does something like this.
Thanks Julian and Dan for your feedback. We will go through the fmac driver to see how to improve OOB selection based on that, and send v2 of this patch.
Greg, will it be possible to ignore this patch for now and merge the rest of the patch series?
Thanks,
Adham
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/4] staging: wilc1000: use runtime configuration for sdio oob interrupt
2019-12-03 19:10 ` Adham.Abozaeid
@ 2019-12-10 9:27 ` Greg KH
0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2019-12-10 9:27 UTC (permalink / raw)
To: Adham.Abozaeid
Cc: julian.calaby, devel, johannes, linux-wireless, Ajay.Kathat
On Tue, Dec 03, 2019 at 07:10:26PM +0000, Adham.Abozaeid@microchip.com wrote:
>
>
> On 11/25/19 2:26 AM, Julian Calaby wrote:
> > Hi Adham,
> >
> > The OOB interrupt is a GPIO and this is an SDIO card, so why not just
> > set the relevant pin in the devicetree and detect it based on that?
> >
> > I'm pretty sure that the Broadcom fmac driver does something like this.
> Thanks Julian and Dan for your feedback. We will go through the fmac driver to see how to improve OOB selection based on that, and send v2 of this patch.
> Greg, will it be possible to ignore this patch for now and merge the rest of the patch series?
Now ignored!
^ permalink raw reply [flat|nested] 8+ messages in thread