Re: [PATCH 1/3] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
On 12/23/2015 10:35 AM, Uri Mashiach wrote: > The power function uses a consumer regulator access to update the WiFi > enable GPIO value. > > Fix the below Oops when trying to modprobe wlcore_spi. > The oops occurs because the wl1271_power_{off,on}() > function doesn't check the power() function pointer. > > [ 23.401447] Unable to handle kernel NULL pointer dereference at > virtual address > [ 23.409954] pgd = c0004000 > [ 23.412922] [] *pgd= > [ 23.416693] Internal error: Oops: 8007 [#1] SMP ARM > [ 23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211 > musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev > omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23 > c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma > snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon > [ 23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted > 4.2.0-2-g951efee-dirty #233 > [ 23.461720] Hardware name: Generic AM33XX (Flattened Device Tree) > [ 23.468123] Workqueue: events request_firmware_work_func > [ 23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000 > [ 23.479341] PC is at 0x0 > [ 23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore] Why can't you just add proper check in wl1271_power_on/wl1271_power_off() instead? -- regards, -grygorii -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] wlcore/wl12xx: spi: add device tree support
On 12/23/2015 10:35 AM, Uri Mashiach wrote: > Add DT support for the wl1271 SPI WiFi. > > Add documentation file for the wl1271 SPI WiFi. > > Signed-off-by: Uri Mashiach> Acked-by: Igor Grinberg > --- > .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++ > drivers/net/wireless/ti/wlcore/spi.c | 67 > +++--- > 2 files changed, 95 insertions(+), 7 deletions(-) > create mode 100644 > Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt > > diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt > b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt > new file mode 100644 > index 000..a3e7eb7 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt > @@ -0,0 +1,35 @@ > +* Texas Instruments wl1271 wireless lan controller > + > +The wl1271 chip can be connected via SPI or via SDIO. This > +document describes the binding for the SPI connected chip. > + > +Required properties: > +- compatible : Should be "ti,wl1271" > +- reg : Chip select address of device > +- spi-max-frequency : Maximum SPI clocking speed of device in Hz > +- ref-clock-frequency : Reference clock frequency > +- interrupts : Should contain interrupt line and trigger type It's good to describe here number of IRQ lines your device have and IRQ types (edge/level) > +- interrupt-parent :Should be the phandle for the interrupt controller interrupt-parent is not required (also interrupts-extended can be used) > +that services interrupts for this device > +- vwlan-supply :Point the node of the regulator that controls the > wl1271 chip WLAN_EN pin Pls, use gpio if this is required just to toggle WLAN_EN pin. [ti,] power-gpio or en-gpio > + > +Optional properties: > +- clock-xtal : boolean, clock is generated from XTAL > + > +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt > + for optional SPI connection related properties,just > + > +Examples: > + > + { > + wl1271@1 { > + compatible = "ti,wl1271"; > + > + reg = <1>; > + spi-max-frequency = <4800>; > + clock-xtal; > + interrupt-parent = <>; > + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; > + wifi-supply = <_fixed>; > + }; > +}; > diff --git a/drivers/net/wireless/ti/wlcore/spi.c > b/drivers/net/wireless/ti/wlcore/spi.c > index d3a4bcb..7281f5a 100644 > --- a/drivers/net/wireless/ti/wlcore/spi.c > +++ b/drivers/net/wireless/ti/wlcore/spi.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > #include > > #include "wlcore.h" > @@ -357,6 +358,54 @@ static struct wl1271_if_operations spi_ops = { > .set_block_size = NULL, > }; > > +#ifdef CONFIG_OF > +static const struct of_device_id wlcore_spi_of_match_table[] = { > + { .compatible = "ti,wl1271" }, > + { } > +}; > + > +/** > + * wlcore_probe_of - DT node parsing. > + * @spi: SPI slave device parameters. > + * @res: resource parameters. > + * @glue: wl12xx SPI bus to slave device glue parameters. > + * @pdev_data: wlcore device parameters > + */ > +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, > +struct wl12xx_spi_glue *glue, > +struct wlcore_platdev_data *pdev_data) > +{ > + struct device_node *dt_node = spi->dev.of_node; > + int ret; > + > + ret = of_irq_to_resource(dt_node, 0, [0]); > + if (spi->irq != ret) { > + dev_err(glue->dev, "can't get interrupt resource\n"); > + return -EINVAL; > + } SPI core will parse IRQ for you (see below) > + > + if (of_find_property(dt_node, "clock-xtal", NULL)) > + pdev_data->ref_clock_xtal = true; > + > + ret = of_property_read_u32(dt_node, "ref-clock-frequency", > +_data->ref_clock_freq); > + if (IS_ERR_VALUE(ret)) { > + dev_err(glue->dev, > + "can't get reference clock frequency (%d)\n", ret); > + return ret; > + } > + > + return 0; > +} > +#else /* CONFIG_OF */ > +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, > +struct wl12xx_spi_glue *glue, > +struct wlcore_platdev_data *pdev_data) > +{ > + return -ENODATA; > +} > +#endif /* CONFIG_OF */ > + > static int wl1271_probe(struct spi_device *spi) > { > struct wl12xx_spi_glue *glue; > @@ -365,8 +414,7 @@ static int wl1271_probe(struct spi_device *spi) > int ret; > > memset(_data, 0x00, sizeof(pdev_data)); > - > - /* TODO: add DT parsing when needed */ > + memset(res, 0x00, sizeof(res)); > > pdev_data.if_ops = _ops; > > @@ -390,6 +438,13 @@ static int wl1271_probe(struct spi_device *spi)
Re: [PATCH 2/3] wlcore/wl12xx: spi: add device tree support
Hi Grygorii, On 12/23/2015 12:25 PM, Grygorii Strashko wrote: On 12/23/2015 10:35 AM, Uri Mashiach wrote: Add DT support for the wl1271 SPI WiFi. Add documentation file for the wl1271 SPI WiFi. Signed-off-by: Uri MashiachAcked-by: Igor Grinberg --- .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++ drivers/net/wireless/ti/wlcore/spi.c | 67 +++--- 2 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt new file mode 100644 index 000..a3e7eb7 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt @@ -0,0 +1,35 @@ +* Texas Instruments wl1271 wireless lan controller + +The wl1271 chip can be connected via SPI or via SDIO. This +document describes the binding for the SPI connected chip. + +Required properties: +- compatible : Should be "ti,wl1271" +- reg : Chip select address of device +- spi-max-frequency : Maximum SPI clocking speed of device in Hz +- ref-clock-frequency : Reference clock frequency +- interrupts : Should contain interrupt line and trigger type It's good to describe here number of IRQ lines your device have and IRQ types (edge/level) Maybe IRQ type should be provided by dts file (IRQ_TYPE_LEVEL_HIGH/IRQ_TYPE_EDGE_RISING...) to enable support for additional controllers? +- interrupt-parent :Should be the phandle for the interrupt controller interrupt-parent is not required (also interrupts-extended can be used) Will be done in v2. +that services interrupts for this device +- vwlan-supply :Point the node of the regulator that controls the wl1271 chip WLAN_EN pin Pls, use gpio if this is required just to toggle WLAN_EN pin. [ti,] power-gpio or en-gpio The controller's power might need toggling in some board implementation. Maybe GPIO and regulator should be implemented? + +Optional properties: +- clock-xtal : boolean, clock is generated from XTAL + +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt + for optional SPI connection related properties,just + +Examples: + + { + wl1271@1 { + compatible = "ti,wl1271"; + + reg = <1>; + spi-max-frequency = <4800>; + clock-xtal; + interrupt-parent = <>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; + wifi-supply = <_fixed>; + }; +}; diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index d3a4bcb..7281f5a 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "wlcore.h" @@ -357,6 +358,54 @@ static struct wl1271_if_operations spi_ops = { .set_block_size = NULL, }; +#ifdef CONFIG_OF +static const struct of_device_id wlcore_spi_of_match_table[] = { + { .compatible = "ti,wl1271" }, + { } +}; + +/** + * wlcore_probe_of - DT node parsing. + * @spi: SPI slave device parameters. + * @res: resource parameters. + * @glue: wl12xx SPI bus to slave device glue parameters. + * @pdev_data: wlcore device parameters + */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + struct device_node *dt_node = spi->dev.of_node; + int ret; + + ret = of_irq_to_resource(dt_node, 0, [0]); + if (spi->irq != ret) { + dev_err(glue->dev, "can't get interrupt resource\n"); + return -EINVAL; + } SPI core will parse IRQ for you (see below) + + if (of_find_property(dt_node, "clock-xtal", NULL)) + pdev_data->ref_clock_xtal = true; + + ret = of_property_read_u32(dt_node, "ref-clock-frequency", + _data->ref_clock_freq); + if (IS_ERR_VALUE(ret)) { + dev_err(glue->dev, + "can't get reference clock frequency (%d)\n", ret); + return ret; + } + + return 0; +} +#else /* CONFIG_OF */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + return -ENODATA; +} +#endif /* CONFIG_OF */ + static int wl1271_probe(struct spi_device *spi) { struct wl12xx_spi_glue *glue; @@ -365,8 +414,7 @@ static int wl1271_probe(struct spi_device *spi) int ret; memset(_data, 0x00, sizeof(pdev_data)); - - /* TODO:
Re: MediaTek WiFi hardware support in upstream kernel
On 27.06.2015 22:45, poma wrote: > > mt7601u landed in 'linux-next' > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/drivers/net/wireless/mediatek/mt7601u > > the v4.2 kernel is predicted for Sunday, 2015-08-23 > http://phb-crystal-ball.org > > For the firmware(mt7601u.bin) as part of the essential functionality of the > device > it would be good to land in 'linux-firmware' *even* before the actual kernel > release v4.2 > http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree > > > tempus fugit > Add firmware for mt7601u. version 34. http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/?id=9df5430 Thanks Hua Shao for the firmware, and of course, thanks Jakub Kiciński for the driver. Oh yeah! -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] net: rfkill-gpio: more ACPI IDs for BCM Blutooth modules
These are used with BCM43241 Wi-Fi/Bluetooth Combo Device. Signed-off-by: Heikki Krogerus--- net/rfkill/rfkill-gpio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 9312722..ba6d61d 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -164,9 +164,12 @@ static int rfkill_gpio_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id rfkill_acpi_match[] = { { "BCM2E1A", RFKILL_TYPE_BLUETOOTH }, + { "BCM2E3A", RFKILL_TYPE_BLUETOOTH }, { "BCM2E3D", RFKILL_TYPE_BLUETOOTH }, + { "BCM2E3F", RFKILL_TYPE_BLUETOOTH }, { "BCM2E40", RFKILL_TYPE_BLUETOOTH }, { "BCM2E64", RFKILL_TYPE_BLUETOOTH }, + { "BCM2E7B", RFKILL_TYPE_BLUETOOTH }, { "BCM4752", RFKILL_TYPE_GPS }, { "LNV4752", RFKILL_TYPE_GPS }, { }, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
Hi Grygorii, On 12/23/2015 12:08 PM, Grygorii Strashko wrote: On 12/23/2015 10:35 AM, Uri Mashiach wrote: The power function uses a consumer regulator access to update the WiFi enable GPIO value. Fix the below Oops when trying to modprobe wlcore_spi. The oops occurs because the wl1271_power_{off,on}() function doesn't check the power() function pointer. [ 23.401447] Unable to handle kernel NULL pointer dereference at virtual address [ 23.409954] pgd = c0004000 [ 23.412922] [] *pgd= [ 23.416693] Internal error: Oops: 8007 [#1] SMP ARM [ 23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211 musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23 c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon [ 23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted 4.2.0-2-g951efee-dirty #233 [ 23.461720] Hardware name: Generic AM33XX (Flattened Device Tree) [ 23.468123] Workqueue: events request_firmware_work_func [ 23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000 [ 23.479341] PC is at 0x0 [ 23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore] Why can't you just add proper check in wl1271_power_on/wl1271_power_off() instead? Will be done in v2. Thanks, Uri -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] net: rfkill-gpio: more ACPI IDs for BCM Blutooth modules
Hi Heikki, > These are used with BCM43241 Wi-Fi/Bluetooth Combo Device. > > Signed-off-by: Heikki Krogerus> --- > net/rfkill/rfkill-gpio.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c > index 9312722..ba6d61d 100644 > --- a/net/rfkill/rfkill-gpio.c > +++ b/net/rfkill/rfkill-gpio.c > @@ -164,9 +164,12 @@ static int rfkill_gpio_remove(struct platform_device > *pdev) > #ifdef CONFIG_ACPI > static const struct acpi_device_id rfkill_acpi_match[] = { > { "BCM2E1A", RFKILL_TYPE_BLUETOOTH }, > + { "BCM2E3A", RFKILL_TYPE_BLUETOOTH }, > { "BCM2E3D", RFKILL_TYPE_BLUETOOTH }, > + { "BCM2E3F", RFKILL_TYPE_BLUETOOTH }, > { "BCM2E40", RFKILL_TYPE_BLUETOOTH }, > { "BCM2E64", RFKILL_TYPE_BLUETOOTH }, > + { "BCM2E7B", RFKILL_TYPE_BLUETOOTH }, > { "BCM4752", RFKILL_TYPE_GPS }, > { "LNV4752", RFKILL_TYPE_GPS }, > { }, I am actually not convinced that these should be added here. We are driving the Broadcom chips via drivers/bluetooth/hci_bcm.c and I pretty sure that these devices should be added there. We moved a few of the existing ones already over, but I have the feeling that in the end all should be moved. Regards Marcel -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] wlcore/wl12xx: spi: add device tree support
* Uri Mashiach[151223 06:38]: > On 12/23/2015 12:25 PM, Grygorii Strashko wrote: > > >>+that services interrupts for this device > >>+- vwlan-supply :Point the node of the regulator that controls the > >>wl1271 chip WLAN_EN pin > > > >Pls, use gpio if this is required just to toggle WLAN_EN pin. > > > >[ti,] power-gpio or en-gpio > > > > > > The controller's power might need toggling in some board implementation. > Maybe GPIO and regulator should be implemented? Yes a regulator for wlcore is best here because to properly control it and the wait needed. Regards, Tony -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: remove wilc_sdio_init
Hi Glen, On Wed, Dec 23, 2015 at 1:33 PM, Glen Leewrote: > wilc_sdio_init return always 1. It is needless, so just remove it and it's > related codes also. > > Signed-off-by: Glen Lee > --- > drivers/staging/wilc1000/wilc_sdio.c | 12 > 1 file changed, 12 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_sdio.c > b/drivers/staging/wilc1000/wilc_sdio.c > index e961b50..caad876 100644 > --- a/drivers/staging/wilc1000/wilc_sdio.c > +++ b/drivers/staging/wilc1000/wilc_sdio.c > @@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev) > dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n"); > } > > -static int wilc_sdio_init(void) > -{ > - return 1; > -} > - > / > * > * Function 0 > @@ -611,13 +606,6 @@ static int sdio_init(struct wilc *wilc) > > g_sdio.irq_gpio = (wilc->dev_irq_num); > > - if (!wilc_sdio_init()) { > - dev_err(>dev, "Failed io init bus...\n"); > - return 0; > - } else { > - return 0; > - } > - This isn't equivalent code as both arms of the if statement eventually call return 0. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: remove wilc_sdio_init
On 2015년 12월 24일 11:39, Julian Calaby wrote: Hi Glen, On Wed, Dec 23, 2015 at 1:33 PM, Glen Leewrote: wilc_sdio_init return always 1. It is needless, so just remove it and it's related codes also. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_sdio.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index e961b50..caad876 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev) dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n"); } -static int wilc_sdio_init(void) -{ - return 1; -} - / * * Function 0 @@ -611,13 +606,6 @@ static int sdio_init(struct wilc *wilc) g_sdio.irq_gpio = (wilc->dev_irq_num); - if (!wilc_sdio_init()) { - dev_err(>dev, "Failed io init bus...\n"); - return 0; - } else { - return 0; - } - This isn't equivalent code as both arms of the if statement eventually call return 0. Hi julian, Yes, you are correct. Actually, The original code was like this before It is patched wrongly. - if (!wilc_sdio_init()) { - dev_err(>dev, "Failed io init bus...\n"); - return 0; - } I could fix this first and then remove wilc_sdio_init(). But I thought that this can be fixed by removing wilc_sdio_init which also fixes always return 0 error. Do you think I should fix "always return 0 error" first and then remove wilc_sdio_init()? Or update change log about the error which cause this? regards, glen lee. Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: remove wilc_sdio_init
On 2015년 12월 24일 12:07, Julian Calaby wrote: Hi Glen, On Thu, Dec 24, 2015 at 2:06 PM, glen leewrote: On 2015년 12월 24일 11:39, Julian Calaby wrote: Hi Glen, On Wed, Dec 23, 2015 at 1:33 PM, Glen Lee wrote: wilc_sdio_init return always 1. It is needless, so just remove it and it's related codes also. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/wilc_sdio.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index e961b50..caad876 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev) dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n"); } -static int wilc_sdio_init(void) -{ - return 1; -} - / * * Function 0 @@ -611,13 +606,6 @@ static int sdio_init(struct wilc *wilc) g_sdio.irq_gpio = (wilc->dev_irq_num); - if (!wilc_sdio_init()) { - dev_err(>dev, "Failed io init bus...\n"); - return 0; - } else { - return 0; - } - This isn't equivalent code as both arms of the if statement eventually call return 0. Hi julian, Yes, you are correct. Actually, The original code was like this before It is patched wrongly. - if (!wilc_sdio_init()) { - dev_err(>dev, "Failed io init bus...\n"); - return 0; - } I could fix this first and then remove wilc_sdio_init(). But I thought that this can be fixed by removing wilc_sdio_init which also fixes always return 0 error. Do you think I should fix "always return 0 error" first and then remove wilc_sdio_init()? Or update change log about the error which cause this? It should be two patches, my instinct is to do one which fixes it always returning zero, then another that removes the empty function. Fixing bugs then cleaning up seems more logical to me. Hi julian, Thanks for your advise, I will make two patches to fix this. regards, glen lee. Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: remove wilc_sdio_init
Hi Glen, On Thu, Dec 24, 2015 at 2:06 PM, glen leewrote: > > > On 2015년 12월 24일 11:39, Julian Calaby wrote: >> >> Hi Glen, >> >> On Wed, Dec 23, 2015 at 1:33 PM, Glen Lee wrote: >>> >>> wilc_sdio_init return always 1. It is needless, so just remove it and >>> it's >>> related codes also. >>> >>> Signed-off-by: Glen Lee >>> --- >>> drivers/staging/wilc1000/wilc_sdio.c | 12 >>> 1 file changed, 12 deletions(-) >>> >>> diff --git a/drivers/staging/wilc1000/wilc_sdio.c >>> b/drivers/staging/wilc1000/wilc_sdio.c >>> index e961b50..caad876 100644 >>> --- a/drivers/staging/wilc1000/wilc_sdio.c >>> +++ b/drivers/staging/wilc1000/wilc_sdio.c >>> @@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc >>> *dev) >>> dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n"); >>> } >>> >>> -static int wilc_sdio_init(void) >>> -{ >>> - return 1; >>> -} >>> - >>> / >>>* >>>* Function 0 >>> @@ -611,13 +606,6 @@ static int sdio_init(struct wilc *wilc) >>> >>> g_sdio.irq_gpio = (wilc->dev_irq_num); >>> >>> - if (!wilc_sdio_init()) { >>> - dev_err(>dev, "Failed io init bus...\n"); >>> - return 0; >>> - } else { >>> - return 0; >>> - } >>> - >> >> This isn't equivalent code as both arms of the if statement eventually >> call return 0. > > > Hi julian, > > Yes, you are correct. > Actually, The original code was like this before It is patched wrongly. > - if (!wilc_sdio_init()) { > - dev_err(>dev, "Failed io init bus...\n"); > - return 0; > - } > I could fix this first and then remove wilc_sdio_init(). > But I thought that this can be fixed by removing wilc_sdio_init which also > fixes always return 0 error. > > Do you think I should fix "always return 0 error" first and then remove > wilc_sdio_init()? > Or update change log about the error which cause this? It should be two patches, my instinct is to do one which fixes it always returning zero, then another that removes the empty function. Fixing bugs then cleaning up seems more logical to me. Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: remove wilc_sdio_init
I kind of feel like we have started to err on the side of breaking things up into too many patches. Linus has said the same thing... This patch is not hard to review, except that the title was bad. Originally it was sent as: [PATCH] staging: wilc1000: fix bug in sdio/spi which is the correct title, but the Fixes tag was in the wrong format so Greg rejected it. Now the Fixes tag is missing entirely which is useless and it is disguised as a cleanup. Cleanup patches should not change run time and fixes should be marked clearly. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 03/21] staging: wilc1000: rename pu8bssid in wilc_set_join_req
This patch renames pu8bssid to bssid to remove pu8 prefix. There is no need to add this prefix in order to show data type of this variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index b24697b..bb4b612 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3365,7 +3365,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) return result; } -int wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, @@ -3397,9 +3397,9 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, msg.body.con_info.params = pJoinParams; msg.vif = vif; - if (pu8bssid) { + if (bssid) { msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL); - memcpy(msg.body.con_info.bssid, pu8bssid, 6); + memcpy(msg.body.con_info.bssid, bssid, 6); } if (pu8ssid) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index eaf3a10..0e40c8f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -326,7 +326,7 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); -int wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 16/21] staging: wilc1000: rename u16ReasonCode in wilc_disconnect
This patch renames u16ReasonCode to reason_code to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 2 +- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 5ddf78d..6e5bccc 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3461,7 +3461,7 @@ int wilc_flush_join_req(struct wilc_vif *vif) return result; } -int wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode) +int wilc_disconnect(struct wilc_vif *vif, u16 reason_code) { int result = 0; struct host_if_msg msg; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index e8c556a..fa5d292 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -332,7 +332,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, u8 security, enum AUTHTYPE auth_type, u8 channel, void *join_params); int wilc_flush_join_req(struct wilc_vif *vif); -int wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); +int wilc_disconnect(struct wilc_vif *vif, u16 reason_code); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 17/21] staging: wilc1000: remove wilc_free_join_params
wilc_free_join_params call kfree. There is no need to use wrapper function, so use kfree directly. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 8 drivers/staging/wilc1000/host_interface.h | 3 --- drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 6e5bccc..724b4bd 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4609,14 +4609,6 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) return (void *)pNewJoinBssParam; } -void wilc_free_join_params(void *pJoinParams) -{ - if ((struct bss_param *)pJoinParams) - kfree((struct bss_param *)pJoinParams); - else - PRINT_ER("Unable to FREE null pointer\n"); -} - s32 wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *pBSSID, char TID) { s32 result = 0; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index fa5d292..7ac85f2 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -365,9 +365,6 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID); s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg); int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index); int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); - -void wilc_free_join_params(void *pJoinParams); - s32 wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics); void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index 53fb2d4..be5704b 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -196,7 +196,7 @@ static void clear_shadow_scan(void) last_scanned_shadow[last_scanned_cnt].pu8IEs = NULL; } - wilc_free_join_params(last_scanned_shadow[i].pJoinParams); + kfree(last_scanned_shadow[i].pJoinParams); last_scanned_shadow[i].pJoinParams = NULL; } last_scanned_cnt = 0; @@ -282,7 +282,7 @@ static void remove_network_from_shadow(unsigned long arg) kfree(last_scanned_shadow[i].pu8IEs); last_scanned_shadow[i].pu8IEs = NULL; - wilc_free_join_params(last_scanned_shadow[i].pJoinParams); + kfree(last_scanned_shadow[i].pJoinParams); for (j = i; (j < last_scanned_cnt - 1); j++) last_scanned_shadow[j] = last_scanned_shadow[j + 1]; @@ -376,7 +376,7 @@ static void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, last_scanned_shadow[ap_index].u32TimeRcvdInScanCached = jiffies; last_scanned_shadow[ap_index].u8Found = 1; if (ap_found != -1) - wilc_free_join_params(last_scanned_shadow[ap_index].pJoinParams); + kfree(last_scanned_shadow[ap_index].pJoinParams); last_scanned_shadow[ap_index].pJoinParams = pJoinParams; } -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 14/21] staging: wilc1000: use kmemdup instead of kmalloc and memcpy
This patch changes kmalloc/memcpy to kmemdup. It is also added error checking to return -ENOMEM if kmemdup is failed. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 79f3d9f..6518942 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3398,20 +3398,23 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.vif = vif; if (bssid) { - msg.body.con_info.bssid = kmalloc(6, GFP_KERNEL); - memcpy(msg.body.con_info.bssid, bssid, 6); + msg.body.con_info.bssid = kmemdup(bssid, 6, GFP_KERNEL); + if (!msg.body.con_info.bssid) + return -ENOMEM; } if (ssid) { msg.body.con_info.ssid_len = ssid_len; - msg.body.con_info.ssid = kmalloc(ssid_len, GFP_KERNEL); - memcpy(msg.body.con_info.ssid, ssid, ssid_len); + msg.body.con_info.ssid = kmemdup(ssid, ssid_len, GFP_KERNEL); + if (!msg.body.con_info.ssid) + return -ENOMEM; } if (ies) { msg.body.con_info.ies_len = ies_len; - msg.body.con_info.ies = kmalloc(ies_len, GFP_KERNEL); - memcpy(msg.body.con_info.ies, ies, ies_len); + msg.body.con_info.ies = kmemdup(ies, ies_len, GFP_KERNEL); + if (!msg.body.con_info.ies) + return -ENOMEM; } if (hif_drv->hif_state < HOST_IF_CONNECTING) hif_drv->hif_state = HOST_IF_CONNECTING; -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 01/21] staging: wilc1000: fix return type of wilc_flush_join_req
This patch changes return type of wilc_flush_join_req from s32 to int. The result variable gets return value from wilc_mq_send that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 78d26ee..78d58e0 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3432,9 +3432,9 @@ s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, return result; } -s32 wilc_flush_join_req(struct wilc_vif *vif) +int wilc_flush_join_req(struct wilc_vif *vif) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 13d253c..af85824 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -331,7 +331,7 @@ s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); -s32 wilc_flush_join_req(struct wilc_vif *vif); +int wilc_flush_join_req(struct wilc_vif *vif); s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/21] staging: wilc1000: fix return type of wilc_set_join_req
This patch changes return type of wilc_set_join_req from s32 to int. The result variable gets return value from wilc_mq_send that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 78d58e0..b24697b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3365,13 +3365,13 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) return result; } -s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index af85824..eaf3a10 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -326,7 +326,7 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); -s32 wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *pu8bssid, const u8 *pu8ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 18/21] staging: wilc1000: fix return type of wilc_get_rssi
This patch changes return type of wilc_get_rssi from s32 to int. The result variable gets return value from wilc_mq_send that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 724b4bd..c059e6d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3628,9 +3628,9 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, return result; } -s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi) +int wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 7ac85f2..51ec72c 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -334,7 +334,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, int wilc_flush_join_req(struct wilc_vif *vif); int wilc_disconnect(struct wilc_vif *vif, u16 reason_code); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); -s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); +int wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 12/21] staging: wilc1000: rename u8channel in wilc_set_join_req
This patch renames u8channel to channel to remove u8 prefix. There is no need to add prefix in order to show data type of this variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d3c595e..66abfa7 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3369,7 +3369,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, u8 security, enum AUTHTYPE auth_type, - u8 u8channel, void *pJoinParams) + u8 channel, void *pJoinParams) { int result = 0; struct host_if_msg msg; @@ -3391,7 +3391,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.body.con_info.security = security; msg.body.con_info.auth_type = auth_type; - msg.body.con_info.ch = u8channel; + msg.body.con_info.ch = channel; msg.body.con_info.result = connect_result; msg.body.con_info.arg = user_arg; msg.body.con_info.params = pJoinParams; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 3d5fea7..b12c04f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -330,7 +330,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, u8 security, enum AUTHTYPE auth_type, - u8 u8channel, void *pJoinParams); + u8 channel, void *pJoinParams); int wilc_flush_join_req(struct wilc_vif *vif); s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/21] staging: wilc1000: rename tenuAuth_type in wilc_set_join_req
This patch renames tenuAuth_type to auth_type to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 64189fa..d3c595e 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3368,7 +3368,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, - u8 security, enum AUTHTYPE tenuAuth_type, + u8 security, enum AUTHTYPE auth_type, u8 u8channel, void *pJoinParams) { int result = 0; @@ -3390,7 +3390,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.id = HOST_IF_MSG_CONNECT; msg.body.con_info.security = security; - msg.body.con_info.auth_type = tenuAuth_type; + msg.body.con_info.auth_type = auth_type; msg.body.con_info.ch = u8channel; msg.body.con_info.result = connect_result; msg.body.con_info.arg = user_arg; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index bb08e7f..3d5fea7 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -329,7 +329,7 @@ int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, - u8 security, enum AUTHTYPE tenuAuth_type, + u8 security, enum AUTHTYPE auth_type, u8 u8channel, void *pJoinParams); int wilc_flush_join_req(struct wilc_vif *vif); s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/21] staging: wilc1000: rename pJoinParams in wilc_set_join_req
This patch renames pJoinParams to join_params to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 66abfa7..79f3d9f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3369,7 +3369,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, u8 security, enum AUTHTYPE auth_type, - u8 channel, void *pJoinParams) + u8 channel, void *join_params) { int result = 0; struct host_if_msg msg; @@ -3380,7 +3380,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, return -EFAULT; } - if (!pJoinParams) { + if (!join_params) { PRINT_ER("Unable to Join - JoinParams is NULL\n"); return -EFAULT; } @@ -3394,7 +3394,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.body.con_info.ch = channel; msg.body.con_info.result = connect_result; msg.body.con_info.arg = user_arg; - msg.body.con_info.params = pJoinParams; + msg.body.con_info.params = join_params; msg.vif = vif; if (bssid) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index b12c04f..698d1b6 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -330,7 +330,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, u8 security, enum AUTHTYPE auth_type, - u8 channel, void *pJoinParams); + u8 channel, void *join_params); int wilc_flush_join_req(struct wilc_vif *vif); s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/21] staging: wilc1000: rename pu8IEs in wilc_set_join_req
This patch renames pu8IEs to ies to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4730b60..bf1597c 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3366,7 +3366,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) } int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssid_len, const u8 *pu8IEs, size_t IEsLen, + size_t ssid_len, const u8 *ies, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) @@ -3408,10 +3408,10 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, memcpy(msg.body.con_info.ssid, ssid, ssid_len); } - if (pu8IEs) { + if (ies) { msg.body.con_info.ies_len = IEsLen; msg.body.con_info.ies = kmalloc(IEsLen, GFP_KERNEL); - memcpy(msg.body.con_info.ies, pu8IEs, IEsLen); + memcpy(msg.body.con_info.ies, ies, IEsLen); } if (hif_drv->hif_state < HOST_IF_CONNECTING) hif_drv->hif_state = HOST_IF_CONNECTING; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 4c4674b..44929a6 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -327,7 +327,7 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssid_len, const u8 *pu8IEs, size_t IEsLen, + size_t ssid_len, const u8 *ies, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 19/21] staging: wilc1000: rename ps8Rssi in wilc_get_rssi
This patch renames ps8Rssi to rssi_level to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index c059e6d..e1e123b 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3628,7 +3628,7 @@ s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, return result; } -int wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi) +int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) { int result = 0; struct host_if_msg msg; @@ -3646,12 +3646,12 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi) down(_drv->sem_get_rssi); - if (!ps8Rssi) { + if (!rssi_level) { PRINT_ER("RSS pointer value is null"); return -EFAULT; } - *ps8Rssi = rssi; + *rssi_level = rssi; return result; } diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 51ec72c..4506e0b 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -334,7 +334,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, int wilc_flush_join_req(struct wilc_vif *vif); int wilc_disconnect(struct wilc_vif *vif, u16 reason_code); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); -int wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); +int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level); s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType, u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 07/21] staging: wilc1000: rename IEsLen in wilc_set_join_req
This patch renames IEsLen to ies_len to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 8 drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bf1597c..4421bab 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3366,7 +3366,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) } int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssid_len, const u8 *ies, size_t IEsLen, + size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) @@ -3409,9 +3409,9 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, } if (ies) { - msg.body.con_info.ies_len = IEsLen; - msg.body.con_info.ies = kmalloc(IEsLen, GFP_KERNEL); - memcpy(msg.body.con_info.ies, ies, IEsLen); + msg.body.con_info.ies_len = ies_len; + msg.body.con_info.ies = kmalloc(ies_len, GFP_KERNEL); + memcpy(msg.body.con_info.ies, ies, ies_len); } if (hif_drv->hif_state < HOST_IF_CONNECTING) hif_drv->hif_state = HOST_IF_CONNECTING; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 44929a6..5edb178 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -327,7 +327,7 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssid_len, const u8 *ies, size_t IEsLen, + size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/21] staging: wilc1000: rename pu8ssid in wilc_set_join_req
This patch renames pu8ssid to ssid to remove pu8 prefix. There is no need to add this prefix in order to show data type of this variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index bb4b612..a146d4f 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3365,7 +3365,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) return result; } -int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, @@ -3402,10 +3402,10 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *pu8ssid, memcpy(msg.body.con_info.bssid, bssid, 6); } - if (pu8ssid) { + if (ssid) { msg.body.con_info.ssid_len = ssidLen; msg.body.con_info.ssid = kmalloc(ssidLen, GFP_KERNEL); - memcpy(msg.body.con_info.ssid, pu8ssid, ssidLen); + memcpy(msg.body.con_info.ssid, ssid, ssidLen); } if (pu8IEs) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 0e40c8f..5d6f807 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -326,7 +326,7 @@ int wilc_set_pmkid_info(struct wilc_vif *vif, int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); -int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *pu8ssid, +int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 15/21] staging: wilc1000: fix return type of wilc_disconnect
This patch changes return type of wilc_disconnect from s32 to int. The result variable gets return value from wilc_disconnect that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 6518942..5ddf78d 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3461,9 +3461,9 @@ int wilc_flush_join_req(struct wilc_vif *vif) return result; } -s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode) +int wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode) { - s32 result = 0; + int result = 0; struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 698d1b6..e8c556a 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -332,7 +332,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, u8 security, enum AUTHTYPE auth_type, u8 channel, void *join_params); int wilc_flush_join_req(struct wilc_vif *vif); -s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); +int wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); s32 wilc_get_rssi(struct wilc_vif *vif, s8 *ps8Rssi); s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType, -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/21] staging: wilc1000: rename pvUserArg in wilc_set_join_req
This patch renames pvUserArg to user_arg to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index d691c95..1190359 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3367,7 +3367,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, - wilc_connect_result connect_result, void *pvUserArg, + wilc_connect_result connect_result, void *user_arg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) { @@ -3393,7 +3393,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.body.con_info.auth_type = tenuAuth_type; msg.body.con_info.ch = u8channel; msg.body.con_info.result = connect_result; - msg.body.con_info.arg = pvUserArg; + msg.body.con_info.arg = user_arg; msg.body.con_info.params = pJoinParams; msg.vif = vif; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index b426132..9e66d5e 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -328,7 +328,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, - wilc_connect_result connect_result, void *pvUserArg, + wilc_connect_result connect_result, void *user_arg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); int wilc_flush_join_req(struct wilc_vif *vif); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: ath9k driver broken since kernel v4.2
Hi Bart Am 24.12.2015 um 08:34 schrieb Bart Van Assche: > Hello, > > The ath9k driver drops more than 90% of all packets with Linux kernel > v4.4-rc6 on my laptop. This behavior also occurs with kernel v4.2. > However, with Linux kernel versions v4.1.5 and v3.19.3 the ath9k driver > works fine on the same laptop. Is this report sufficient for one of the > ath9k drivers to look further into this or do you perhaps expect me to > run a bisect ? Many people using this driver. For example it works fine on my laptop. Since no body knows why your HW is affected try to use git bisect. -- Regards, Oleksij signature.asc Description: OpenPGP digital signature
[PATCH v2 2/2] staging: wilc1000: remove wilc_sdio_init
wilc_sdio_init return always 1, which is needless. Remove it and it's related codes also. Signed-off-by: Glen Lee--- Changes in v2: separate v1 patch into two patches. --- drivers/staging/wilc1000/wilc_sdio.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 464d27d..caad876 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -185,11 +185,6 @@ static void wilc_sdio_disable_interrupt(struct wilc *dev) dev_info(>dev, "wilc_sdio_disable_interrupt OUT\n"); } -static int wilc_sdio_init(void) -{ - return 1; -} - / * * Function 0 @@ -611,11 +606,6 @@ static int sdio_init(struct wilc *wilc) g_sdio.irq_gpio = (wilc->dev_irq_num); - if (!wilc_sdio_init()) { - dev_err(>dev, "Failed io init bus...\n"); - return 0; - } - /** * function 0 csa enable **/ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/2] staging: wilc1000: fix always return 0 error
This patch fixes a bug that return always 0 so it fails every time. Fixes: c1af9db78950 ("staging: wilc1000: call linux_sdio_init instead of io_init") Signed-off-by: Glen Lee--- Changes in v2: separate v1 patch into two patches. --- drivers/staging/wilc1000/wilc_sdio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index e961b50..464d27d 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -614,8 +614,6 @@ static int sdio_init(struct wilc *wilc) if (!wilc_sdio_init()) { dev_err(>dev, "Failed io init bus...\n"); return 0; - } else { - return 0; } /** -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
ath9k driver broken since kernel v4.2
Hello, The ath9k driver drops more than 90% of all packets with Linux kernel v4.4-rc6 on my laptop. This behavior also occurs with kernel v4.2. However, with Linux kernel versions v4.1.5 and v3.19.3 the ath9k driver works fine on the same laptop. Is this report sufficient for one of the ath9k drivers to look further into this or do you perhaps expect me to run a bisect ? Thanks, Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] wlcore/wl12xx: spi: add device tree support
Hi Grygorii, On 12/23/2015 12:25 PM, Grygorii Strashko wrote: On 12/23/2015 10:35 AM, Uri Mashiach wrote: Add DT support for the wl1271 SPI WiFi. Add documentation file for the wl1271 SPI WiFi. Signed-off-by: Uri MashiachAcked-by: Igor Grinberg --- .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++ drivers/net/wireless/ti/wlcore/spi.c | 67 +++--- 2 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt new file mode 100644 index 000..a3e7eb7 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt @@ -0,0 +1,35 @@ +* Texas Instruments wl1271 wireless lan controller + +The wl1271 chip can be connected via SPI or via SDIO. This +document describes the binding for the SPI connected chip. + +Required properties: +- compatible : Should be "ti,wl1271" +- reg : Chip select address of device +- spi-max-frequency : Maximum SPI clocking speed of device in Hz +- ref-clock-frequency : Reference clock frequency +- interrupts : Should contain interrupt line and trigger type It's good to describe here number of IRQ lines your device have and IRQ types (edge/level) +- interrupt-parent :Should be the phandle for the interrupt controller interrupt-parent is not required (also interrupts-extended can be used) +that services interrupts for this device +- vwlan-supply :Point the node of the regulator that controls the wl1271 chip WLAN_EN pin Pls, use gpio if this is required just to toggle WLAN_EN pin. [ti,] power-gpio or en-gpio + +Optional properties: +- clock-xtal : boolean, clock is generated from XTAL + +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt + for optional SPI connection related properties,just + +Examples: + + { + wl1271@1 { + compatible = "ti,wl1271"; + + reg = <1>; + spi-max-frequency = <4800>; + clock-xtal; + interrupt-parent = <>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; + wifi-supply = <_fixed>; + }; +}; diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index d3a4bcb..7281f5a 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "wlcore.h" @@ -357,6 +358,54 @@ static struct wl1271_if_operations spi_ops = { .set_block_size = NULL, }; +#ifdef CONFIG_OF +static const struct of_device_id wlcore_spi_of_match_table[] = { + { .compatible = "ti,wl1271" }, + { } +}; + +/** + * wlcore_probe_of - DT node parsing. + * @spi: SPI slave device parameters. + * @res: resource parameters. + * @glue: wl12xx SPI bus to slave device glue parameters. + * @pdev_data: wlcore device parameters + */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + struct device_node *dt_node = spi->dev.of_node; + int ret; + + ret = of_irq_to_resource(dt_node, 0, [0]); + if (spi->irq != ret) { + dev_err(glue->dev, "can't get interrupt resource\n"); + return -EINVAL; + } SPI core will parse IRQ for you (see below) The IRQ type should be stored in res[0].flags. Is there an alternative to of_irq_to_resource() for getting the IRQ type? + + if (of_find_property(dt_node, "clock-xtal", NULL)) + pdev_data->ref_clock_xtal = true; + + ret = of_property_read_u32(dt_node, "ref-clock-frequency", + _data->ref_clock_freq); + if (IS_ERR_VALUE(ret)) { + dev_err(glue->dev, + "can't get reference clock frequency (%d)\n", ret); + return ret; + } + + return 0; +} +#else /* CONFIG_OF */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + return -ENODATA; +} +#endif /* CONFIG_OF */ + static int wl1271_probe(struct spi_device *spi) { struct wl12xx_spi_glue *glue; @@ -365,8 +414,7 @@ static int wl1271_probe(struct spi_device *spi) int ret; memset(_data, 0x00, sizeof(pdev_data)); - - /* TODO: add DT parsing when needed */ + memset(res, 0x00, sizeof(res)); pdev_data.if_ops = _ops; @@ -390,6 +438,13 @@ static int wl1271_probe(struct
[PATCH 10/21] staging: wilc1000: rename u8security in wilc_set_join_req
This patch renames u8security to security to remove u8 prefix. There is no need to add prefix in order to show data type of this variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 1190359..64189fa 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3368,7 +3368,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, - u8 u8security, enum AUTHTYPE tenuAuth_type, + u8 security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) { int result = 0; @@ -3389,7 +3389,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.id = HOST_IF_MSG_CONNECT; - msg.body.con_info.security = u8security; + msg.body.con_info.security = security; msg.body.con_info.auth_type = tenuAuth_type; msg.body.con_info.ch = u8channel; msg.body.con_info.result = connect_result; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 9e66d5e..bb08e7f 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -329,7 +329,7 @@ int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, wilc_connect_result connect_result, void *user_arg, - u8 u8security, enum AUTHTYPE tenuAuth_type, + u8 security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); int wilc_flush_join_req(struct wilc_vif *vif); s32 wilc_disconnect(struct wilc_vif *vif, u16 u16ReasonCode); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 08/21] staging: wilc1000: rename pfConnectResult in wilc_set_join_req
This patch renames pfConnectResult to connect_result to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 6 +++--- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 4421bab..d691c95 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3367,7 +3367,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, - wilc_connect_result pfConnectResult, void *pvUserArg, + wilc_connect_result connect_result, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) { @@ -3375,7 +3375,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, struct host_if_msg msg; struct host_if_drv *hif_drv = vif->hif_drv; - if (!hif_drv || !pfConnectResult) { + if (!hif_drv || !connect_result) { PRINT_ER("Driver is null\n"); return -EFAULT; } @@ -3392,7 +3392,7 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, msg.body.con_info.security = u8security; msg.body.con_info.auth_type = tenuAuth_type; msg.body.con_info.ch = u8channel; - msg.body.con_info.result = pfConnectResult; + msg.body.con_info.result = connect_result; msg.body.con_info.arg = pvUserArg; msg.body.con_info.params = pJoinParams; msg.vif = vif; diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 5edb178..b426132 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -328,7 +328,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, size_t ssid_len, const u8 *ies, size_t ies_len, - wilc_connect_result pfConnectResult, void *pvUserArg, + wilc_connect_result connect_result, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); int wilc_flush_join_req(struct wilc_vif *vif); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 05/21] staging: wilc1000: rename ssidLen in wilc_set_join_req
This patch renames ssidLen to ssid_len to avoid camelcase. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 8 drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index a146d4f..4730b60 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3366,7 +3366,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) } int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, + size_t ssid_len, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams) @@ -3403,9 +3403,9 @@ int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, } if (ssid) { - msg.body.con_info.ssid_len = ssidLen; - msg.body.con_info.ssid = kmalloc(ssidLen, GFP_KERNEL); - memcpy(msg.body.con_info.ssid, ssid, ssidLen); + msg.body.con_info.ssid_len = ssid_len; + msg.body.con_info.ssid = kmalloc(ssid_len, GFP_KERNEL); + memcpy(msg.body.con_info.ssid, ssid, ssid_len); } if (pu8IEs) { diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 5d6f807..4c4674b 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -327,7 +327,7 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); int wilc_wait_msg_queue_idle(void); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, - size_t ssidLen, const u8 *pu8IEs, size_t IEsLen, + size_t ssid_len, const u8 *pu8IEs, size_t IEsLen, wilc_connect_result pfConnectResult, void *pvUserArg, u8 u8security, enum AUTHTYPE tenuAuth_type, u8 u8channel, void *pJoinParams); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 20/21] staging: wilc1000: fix return type of wilc_get_statistics
This patch changes return type of wilc_get_statistics from s32 to int. The result variable gets return value from wilc_mq_send that has return type of int. It should be changed return type of this function as well as data type of result variable. Signed-off-by: Chaehyun Lim--- drivers/staging/wilc1000/host_interface.c | 4 ++-- drivers/staging/wilc1000/host_interface.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index e1e123b..732ea96 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3656,9 +3656,9 @@ int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level) return result; } -s32 wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics) +int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics) { - s32 result = 0; + int result = 0; struct host_if_msg msg; memset(, 0, sizeof(struct host_if_msg)); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 4506e0b..c64dc13d 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -365,7 +365,7 @@ s32 wilc_listen_state_expired(struct wilc_vif *vif, u32 u32SessionID); s32 wilc_frame_register(struct wilc_vif *vif, u16 u16FrameType, bool bReg); int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index); int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); -s32 wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics); +int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *pstrStatistics); void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); int wilc_get_vif_idx(struct wilc_vif *vif); -- 2.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] NFC: nci: fix handling return value of nci_hci_create_pipe
The function return NCI_HCI_INVALID_PIPE in case of error. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda--- net/nfc/nci/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/nfc/nci/hci.c b/net/nfc/nci/hci.c index 2aedac1..a0ab26d 100644 --- a/net/nfc/nci/hci.c +++ b/net/nfc/nci/hci.c @@ -676,7 +676,7 @@ int nci_hci_connect_gate(struct nci_dev *ndev, break; default: pipe = nci_hci_create_pipe(ndev, dest_host, dest_gate, ); - if (pipe < 0) + if (pipe == NCI_HCI_INVALID_PIPE) return r; pipe_created = true; break; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] enable setting MAC address for r8723au
Daniel Lenskiwrites: > On Mon, Dec 21, 2015 at 9:53 AM, Larry Finger > wrote: >> On 12/20/2015 08:28 PM, Dan Lenski wrote: >>> >>> Signed-off-by: Dan Lenski >> >> >> The commit message should be in this patch rather than in the non-patch >> previous mail. If this patch were to be accepted, all that explanation would >> be lost! >> >> Rather than issuing a warning when the MAC is changed after the interface >> has been brought up, have you considered changing the value of >> rtw_adapter->bup to zero whenever the connection goes down? Would that help >> with the confusion in the user-space tools? > > No. rtw_adapter isn't visible to userspace at all. NetworkManager, for > instance, seems to get confused when *any* up interface changes its > MAC address. > > bup should *not* be reset to zero when the device is closed. > netdev_open23a() checks or bup==0 and calls rtl8723au_hal_init() to do > hw initialization and firmware download if so. This is unnecessary > after subsequent re-opening, which is why netdev_close() doesn't set > bup=0. > >> NACK. > > I'll resubmit with the commit message fixed and the warning removed. > In addition, do *not* overwrite the eeprompriv.mac_addr - that struct is a clean copy of the eeprom's data and should not be modified. Please changed the dev entry and make sure they driver updates from there instead. Second, please CC me directly as the driver maintainer. For longer term, please try out rtl8xxxu, hopefully we can rm -rf drivers/staging/rtl8723au soon. Jes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
pull-request mwifiex-firmware 2015-12-23
The following changes since commit 7f02df82736a85606cd9f33cb709545d9fc5326e: linux-firmware: update Marvell 8897-B0 firmware images to p112 (2015-01-27 16:02:53 +0530) are available in the git repository at: git://git.marvell.com/mwifiex-firmware.git master for you to fetch changes up to e92f8b3f65443764297b947b1843955d9a65dde7: linux-firmware: update Marvell USB8797-B0 firmware image (2015-11-02 06:25:05 -0500) Amitkumar Karwar (3): linux-firmware: update Marvell 8897-B0 firmware images to 7.p18 linux-firmware: update Marvell 8897-B0 firmware images to 7.p53 linux-firmware: update Marvell USB8797-B0 firmware image Avinash Patil (1): linux-firmware: add Marvell SD/USB8801 B0 firmware images WHENCE | 12 +--- mrvl/pcie8897_uapsta.bin | Bin 759128 -> 803884 bytes mrvl/sd8801_uapsta.bin | Bin 0 -> 258680 bytes mrvl/sd8897_uapsta.bin | Bin 734612 -> 780760 bytes mrvl/usb8797_uapsta.bin | Bin 551720 -> 553456 bytes mrvl/usb8801_uapsta.bin | Bin 0 -> 255948 bytes 6 files changed, 9 insertions(+), 3 deletions(-) create mode 100755 mrvl/sd8801_uapsta.bin create mode 100755 mrvl/usb8801_uapsta.bin -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/3] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops)
The power function uses a consumer regulator access to update the WiFi enable GPIO value. Fix the below Oops when trying to modprobe wlcore_spi. The oops occurs because the wl1271_power_{off,on}() function doesn't check the power() function pointer. [ 23.401447] Unable to handle kernel NULL pointer dereference at virtual address [ 23.409954] pgd = c0004000 [ 23.412922] [] *pgd= [ 23.416693] Internal error: Oops: 8007 [#1] SMP ARM [ 23.422168] Modules linked in: wl12xx wlcore mac80211 cfg80211 musb_dsps musb_hdrc usbcore usb_common snd_soc_simple_card evdev joydev omap_rng wlcore_spi snd_soc_tlv320aic23_i2c rng_core snd_soc_tlv320aic23 c_can_platform c_can can_dev snd_soc_davinci_mcasp snd_soc_edma snd_soc_omap omap_wdt musb_am335x cpufreq_dt thermal_sys hwmon [ 23.453253] CPU: 0 PID: 36 Comm: kworker/0:2 Not tainted 4.2.0-2-g951efee-dirty #233 [ 23.461720] Hardware name: Generic AM33XX (Flattened Device Tree) [ 23.468123] Workqueue: events request_firmware_work_func [ 23.473690] task: de32efc0 ti: de4ee000 task.ti: de4ee000 [ 23.479341] PC is at 0x0 [ 23.482112] LR is at wl12xx_set_power_on+0x28/0x124 [wlcore] [ 23.488074] pc : [<>]lr : []psr: 6013 [ 23.488074] sp : de4efe50 ip : 0002 fp : [ 23.500162] r10: de7cdd00 r9 : dc848800 r8 : bf27af00 [ 23.505663] r7 : bf27a1a8 r6 : dcbd8a80 r5 : dce0e2e0 r4 : dce0d2e0 [ 23.512536] r3 : r2 : r1 : 0001 r0 : dc848810 [ 23.519412] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 23.527109] Control: 10c5387d Table: 9cb78019 DAC: 0015 [ 23.533160] Process kworker/0:2 (pid: 36, stack limit = 0xde4ee218) [ 23.539760] Stack: (0xde4efe50 to 0xde4f) [...] [ 23.665030] [] (wl12xx_set_power_on [wlcore]) from [] (wlcore_nvs_cb+0x118/0xa4c [wlcore]) [ 23.675604] [] (wlcore_nvs_cb [wlcore]) from [] (request_firmware_work_func+0x30/0x58) [ 23.685784] [] (request_firmware_work_func) from [] (process_one_work+0x1b4/0x4b4) [ 23.695591] [] (process_one_work) from [] (worker_thread+0x3c/0x4a4) [ 23.704124] [] (worker_thread) from [] (kthread+0xd4/0xf0) [ 23.711747] [] (kthread) from [] (ret_from_fork+0x14/0x3c) [ 23.719357] Code: bad PC value [ 23.722760] ---[ end trace 981be8510db9b3a9 ]--- Fix this by adding a power() function implementation. Signed-off-by: Uri MashiachAcked-by: Igor Grinberg --- drivers/net/wireless/ti/wlcore/spi.c | 37 1 file changed, 37 insertions(+) diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index 44f059f..d3a4bcb 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "wlcore.h" #include "wl12xx_80211.h" @@ -81,6 +82,7 @@ struct wl12xx_spi_glue { struct device *dev; struct platform_device *core; + struct regulator *reg; /* Power regulator */ }; static void wl12xx_spi_reset(struct device *child) @@ -318,11 +320,40 @@ static int __must_check wl12xx_spi_raw_write(struct device *child, int addr, return 0; } +/** + * wl12xx_spi_set_power - power on/off the wl12xx unit + * @child: wl12xx device handle. + * @enable: true/false to power on/off the unit. + * + * use the WiFi enable regulator to enable/disable the WiFi unit. + */ +static int wl12xx_spi_set_power(struct device *child, bool enable) +{ + int ret = 0; + struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent); + + WARN_ON(!glue->reg); + + /* Update regulator state */ + if (enable) { + ret = regulator_enable(glue->reg); + if (ret) + dev_err(child, "Power enable failure\n"); + } else { + ret = regulator_disable(glue->reg); + if (ret) + dev_err(child, "Power disable failure\n"); + } + + return ret; +} + static struct wl1271_if_operations spi_ops = { .read = wl12xx_spi_raw_read, .write = wl12xx_spi_raw_write, .reset = wl12xx_spi_reset, .init = wl12xx_spi_init, + .power = wl12xx_spi_set_power, .set_block_size = NULL, }; @@ -353,6 +384,12 @@ static int wl1271_probe(struct spi_device *spi) * comes from the board-peripherals file */ spi->bits_per_word = 32; + glue->reg = devm_regulator_get(>dev, "vwlan"); + if (IS_ERR(glue->reg)) { + dev_err(glue->dev, "can't get regulator\n"); + return PTR_ERR(glue->reg); + } + ret = spi_setup(spi); if (ret < 0) { dev_err(glue->dev, "spi_setup failed\n"); -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a
[PATCH 2/3] wlcore/wl12xx: spi: add device tree support
Add DT support for the wl1271 SPI WiFi. Add documentation file for the wl1271 SPI WiFi. Signed-off-by: Uri MashiachAcked-by: Igor Grinberg --- .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++ drivers/net/wireless/ti/wlcore/spi.c | 67 +++--- 2 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt diff --git a/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt new file mode 100644 index 000..a3e7eb7 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt @@ -0,0 +1,35 @@ +* Texas Instruments wl1271 wireless lan controller + +The wl1271 chip can be connected via SPI or via SDIO. This +document describes the binding for the SPI connected chip. + +Required properties: +- compatible : Should be "ti,wl1271" +- reg : Chip select address of device +- spi-max-frequency : Maximum SPI clocking speed of device in Hz +- ref-clock-frequency : Reference clock frequency +- interrupts : Should contain interrupt line and trigger type +- interrupt-parent :Should be the phandle for the interrupt controller +that services interrupts for this device +- vwlan-supply :Point the node of the regulator that controls the wl1271 chip WLAN_EN pin + +Optional properties: +- clock-xtal : boolean, clock is generated from XTAL + +- Please consult Documentation/devicetree/bindings/spi/spi-bus.txt + for optional SPI connection related properties, + +Examples: + + { + wl1271@1 { + compatible = "ti,wl1271"; + + reg = <1>; + spi-max-frequency = <4800>; + clock-xtal; + interrupt-parent = <>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; + wifi-supply = <_fixed>; + }; +}; diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c index d3a4bcb..7281f5a 100644 --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "wlcore.h" @@ -357,6 +358,54 @@ static struct wl1271_if_operations spi_ops = { .set_block_size = NULL, }; +#ifdef CONFIG_OF +static const struct of_device_id wlcore_spi_of_match_table[] = { + { .compatible = "ti,wl1271" }, + { } +}; + +/** + * wlcore_probe_of - DT node parsing. + * @spi: SPI slave device parameters. + * @res: resource parameters. + * @glue: wl12xx SPI bus to slave device glue parameters. + * @pdev_data: wlcore device parameters + */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + struct device_node *dt_node = spi->dev.of_node; + int ret; + + ret = of_irq_to_resource(dt_node, 0, [0]); + if (spi->irq != ret) { + dev_err(glue->dev, "can't get interrupt resource\n"); + return -EINVAL; + } + + if (of_find_property(dt_node, "clock-xtal", NULL)) + pdev_data->ref_clock_xtal = true; + + ret = of_property_read_u32(dt_node, "ref-clock-frequency", + _data->ref_clock_freq); + if (IS_ERR_VALUE(ret)) { + dev_err(glue->dev, + "can't get reference clock frequency (%d)\n", ret); + return ret; + } + + return 0; +} +#else /* CONFIG_OF */ +static int wlcore_probe_of(struct spi_device *spi, struct resource *res, + struct wl12xx_spi_glue *glue, + struct wlcore_platdev_data *pdev_data) +{ + return -ENODATA; +} +#endif /* CONFIG_OF */ + static int wl1271_probe(struct spi_device *spi) { struct wl12xx_spi_glue *glue; @@ -365,8 +414,7 @@ static int wl1271_probe(struct spi_device *spi) int ret; memset(_data, 0x00, sizeof(pdev_data)); - - /* TODO: add DT parsing when needed */ + memset(res, 0x00, sizeof(res)); pdev_data.if_ops = _ops; @@ -390,6 +438,13 @@ static int wl1271_probe(struct spi_device *spi) return PTR_ERR(glue->reg); } + ret = wlcore_probe_of(spi, [0], glue, _data); + if (IS_ERR_VALUE(ret)) { + dev_err(glue->dev, + "can't get device tree parameters (%d)\n", ret); + return ret; + } + ret = spi_setup(spi); if (ret < 0) { dev_err(glue->dev, "spi_setup failed\n"); @@ -404,10 +459,6 @@ static int wl1271_probe(struct spi_device *spi) glue->core->dev.parent = >dev; - memset(res, 0x00, sizeof(res)); - -
[PATCH 3/3] wlcore/wl12xx: spi: add wifi support to cm-t335
Device tree modifications: - Pinmux for SPI0 and WiFi GPIOs. - SPI0 node with wlcore as a child node. Cc: Tony LindgrenSigned-off-by: Uri Mashiach Acked-by: Igor Grinberg --- Prerequisites: This patch applies on Tony's omap-for-v4.5/dt branch. arch/arm/boot/dts/am335x-cm-t335.dts | 58 +++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/am335x-cm-t335.dts b/arch/arm/boot/dts/am335x-cm-t335.dts index 42e9b66..41242a5 100644 --- a/arch/arm/boot/dts/am335x-cm-t335.dts +++ b/arch/arm/boot/dts/am335x-cm-t335.dts @@ -11,6 +11,7 @@ /dts-v1/; #include "am33xx.dtsi" +#include / { model = "CompuLab CM-T335"; @@ -40,6 +41,15 @@ regulator-max-microvolt = <330>; }; + /* Regulator for WiFi */ + vwlan_fixed: fixedregulator@2 { + compatible = "regulator-fixed"; + regulator-name = "vwlan_fixed"; + gpio = < 20 GPIO_ACTIVE_HIGH>; /* gpio0_20 */ + enable-active-high; + regulator-boot-off; + }; + backlight { compatible = "pwm-backlight"; pwms = < 0 5 0>; @@ -50,7 +60,10 @@ _pinmux { pinctrl-names = "default"; - pinctrl-0 = <_pins>; + pinctrl-0 = < + _pins + _pins + >; i2c0_pins: pinmux_i2c0_pins { pinctrl-single,pins = < @@ -223,6 +236,21 @@ >; }; + spi0_pins: pinmux_spi0_pins { + pinctrl-single,pins = < + /* spi0_sclk.spi0_sclk */ + AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE0) + /* spi0_d0.spi0_d0 */ + AM33XX_IOPAD(0x954, PIN_OUTPUT_PULLUP | MUX_MODE0) + /* spi0_d1.spi0_d1 */ + AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE0) + /* spi0_cs0.spi0_cs0 */ + AM33XX_IOPAD(0x95C, PIN_OUTPUT | MUX_MODE0) + /* spi0_cs1.spi0_cs1 */ + AM33XX_IOPAD(0x960, PIN_OUTPUT | MUX_MODE0) + >; + }; + /* wl1271 bluetooth */ bluetooth_pins: pinmux_bluetooth_pins { pinctrl-single,pins = < @@ -230,6 +258,16 @@ AM33XX_IOPAD(0x9b0, PIN_OUTPUT_PULLUP | MUX_MODE7) >; }; + + /* wl1271 WiFi */ + wifi_pins: pinmux_wifi_pins { + pinctrl-single,pins = < + /* EMU1.gpio3_8 - WiFi IRQ */ + AM33XX_IOPAD(0x9e8, PIN_INPUT_PULLUP | MUX_MODE7) + /* XDMA_EVENT_INTR1.gpio0_20 - WiFi enable */ + AM33XX_IOPAD(0x9b4, PIN_OUTPUT | MUX_MODE7) + >; + }; }; { @@ -394,3 +432,21 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <_pins>; }; + + { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <_pins>; + ti,pindir-d0-out-d1-in = <1>; + /* WLS1271 WiFi */ + wlcore: wlcore@1 { + compatible = "ti,wl1271"; + reg = <1>; + spi-max-frequency = <4800>; + clock-xtal; + ref-clock-frequency = <3840>; + interrupt-parent = <>; + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; + vwlan-supply = <_fixed>; + }; +}; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] wlcore/wl12xx: spi: add wifi support to cm-t335
Add DT support for WLS1271 SPI driver. Fix oops by adding a power callback. Uri Mashiach (3): wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) wlcore/wl12xx: spi: add device tree support wlcore/wl12xx: spi: add wifi support to cm-t335 .../bindings/net/wireless/ti,wlcore,spi.txt| 35 +++ arch/arm/boot/dts/am335x-cm-t335.dts | 58 +++- drivers/net/wireless/ti/wlcore/spi.c | 104 +++-- 3 files changed, 189 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/wireless/ti,wlcore,spi.txt -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html