Glen Lee [Fri, 18 Dec 2015 09:26:02 +0000 (18:26 +0900)]
staging: wilc1000: fix a bug when unload driver
kernel crashes when load and unload driver several times. I used git bisect to
track down and found that removing NULL setting caused the panic.
This reverts only related codes of the patch(a4ab1ade75a3).
Fixes: a4ab1ade75a3 ("staging: wilc1000: replace drvHandler and hWFIDrv with hif_drv") Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch fixes the checks reported by checkpatch.pl
for Blank lines aren't necessary after an open brace '{' and
Blank lines aren't necessary before a close brace '}'.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There are over-commenting in the wilc_wfi_cfgoperations.c file and most of them
are not helpful to explain what the code does and generate 80 ending
line over warnings. So, all of comments are removed in this patch and the
comments will later be added if necessary with the preferred Linux style.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Leo Kim [Thu, 19 Nov 2015 06:56:32 +0000 (15:56 +0900)]
staging: wilc1000: rename pstrNetworkInfo in CfgScanResult function
This patch renames pstrNetworkInfo to network_info that is
second argument of CfgScanResult function to avoid camelcase.
And, remove the relation comment.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes pUserVoid that is first argument of
update_scan_time function because it is not used in this function.
Remove argument in the function call also.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes pUserVoid that is first argument of
reset_shadow_found function because it is not used in this function.
Remove argument in the function call also.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes pUserVoid that is first argument of
clear_shadow_scan function because it is not used in this function.
Remove argument in the function call also.
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch passes struct wilc to wilc_send_config_pkt. The function
wilc_wlan_cfg_set and wilc_wlan_cfg_get function will get wilc to replace
wilc_dev with it.
Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Glen Lee [Wed, 18 Nov 2015 06:11:26 +0000 (15:11 +0900)]
staging: wilc1000: pass wilc to all function pointers of wilc_hif_func
This patch adds new function parameter struct wilc to all function pointers
of struct wilc_hif_func, and all functions of wilc_sdio.c and wilc_spi.c
need to be changed as it's function pointer is changed.
Pass wilc in all the functions call as well.
The wilc will be passed to functions in linux_wlan_sdio.c and linux_wlan_spi.c
to replace with global variable wilc_dev in the next patch.
Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Glen Lee [Wed, 18 Nov 2015 06:11:25 +0000 (15:11 +0900)]
staging: wilc1000: pass struct wilc to the functions which use hif_func
This patch passes struct wilc to the functions which use hif_func inside.
The function pointers of wilc_hif_func will pass wilc also in the later
patch. Pass wilc to the functions if necessary.
This patch removes PLAT_WMS8304 and it's related codes as well. We will not
use this way of supporting other platform. This will be supported if necessary
by device tree later.
Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Glen Lee [Wed, 18 Nov 2015 06:11:23 +0000 (15:11 +0900)]
staging: wilc1000: remove spi speed control codes
This patch removes spi speed control codes. We are not using define SPEED to
specify speed of spi, it is not proper way of doing this. It will be
provided by the device tree.
The following functions and variable are removed.
MIN_SPEED, MAX_SPEED, SPEED
wilc_spi_set_max_speed
wilc_spi_max_bus_speed
wilc_spi_default_bus_speed
hif_set_max_bus_speed
hif_set_default_bus_speed
Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Glen Lee [Wed, 18 Nov 2015 06:11:22 +0000 (15:11 +0900)]
staging: wilc1000: remove sdio speed control codes
This patch removes spi speed control related functions and variable. We cannot
get exact clock what we need in this way and it can causes some problem in host
side by setting the clock, so remove the codes.
Speed control codes in spi also will removed in next patch, so it's ok to
remove functions in linux_wlan.c and wilc_wlan.c which also not used anymore.
The Following functions and varialbe are removed.
MAX_SPEED, sdio_default_speed
wilc_bus_set_default_speed
wilc_bus_set_max_speed
linux_sdio_set_speed
linux_sdio_get_speed
wilc_sdio_set_max_speed
wilc_sdio_set_default_speed
Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann [Mon, 16 Nov 2015 14:05:10 +0000 (15:05 +0100)]
staging/wilc1000: pass struct wilc to most linux_wlan.c functions
We want to get rid of all global variables in this driver, and
instead pass device structures from one function to another.
This changes the linux_wlan.c and wilc_wlan.c to do this
for the most part. There are a few exceptions where these
functions are themselves called from another part of the driver
that does not have an instance pointer at hand. Changing those
would be a follow-up step.
There are a few other globals that will have to get moved
into struct wilc at a later point.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:09 +0000 (15:05 +0100)]
staging/wilc1000: use more regular probing
So far, my patches tried to do equivalent conversions of the
existing code. This one goes beyond that by restructuring
how the devices get probed. In particular, the spi driver
no longer creates the netdev until the device is probed,
and I've removed the global wilc_sdio_func and wilc_spi_dev
variables in favor of retrieving them from the wilc_dev
variable that will eventually get passed through all functions
instead of using a global.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:08 +0000 (15:05 +0100)]
staging/wilc1000: split out bus specific modules
The SPI and SDIO specific code is now separate enough that
we just need to restructure the Makefile and Kconfig logic
a bit and export a couple of symbols from the common module
to have separate bus glue drivers.
The last remaining user of WILC_SDIO macro checks for the correct
time to wait in an interrupt for the PLL to settle. We can
replace this with a runtime check and remove both WILC_SDIO and
WILC_SPI, as we no longer need conditional compilation based on
the hardware type.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:06 +0000 (15:05 +0100)]
staging/wilc1000: turn enable_irq/disable_irq into callbacks
As a preparation for turning the SDIO side of wilc1000 into a separate
module, this removes the last direct caller from the core module into
the sdio specific portion. All calls to wilc_sdio_enable_interrupt()
and wilc_sdio_disable_interrupt() now go through a function pointer
in wilc_hif_func. We also change arguments slightly to pass the device,
as we are already touching those lines and the change will be needed
later to remove the global variables.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:05 +0000 (15:05 +0100)]
staging/wilc1000: pass hif operations through initialization
The wilc_hif_spi and wilc_hif_sdio structures are part of
the bus specific code, and the generic code should have no knowledge
of their addresses.
This changes the code to reference them only from the bus
specific initialization code, which we can then use to split
up the driver into separate modules.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:04 +0000 (15:05 +0100)]
staging/wilc1000: get rid of WILC_SDIO_IRQ_GPIO
Whether the SDIO function uses an internal or external interrupt
should not be a compiletime decision but be determined at runtime.
This changes the code to pass a GPIO number from the init code
as early as possible, and leaves just one #ifdef WILC_SDIO_IRQ_GPIO
to preserve the previous behavior.
All other locations that check for the interrupt method are turned
into runtime checks based on the gpio number (>=0) or the interrupt
number (>0).
Arnd Bergmann [Mon, 16 Nov 2015 14:05:03 +0000 (15:05 +0100)]
staging/wilc1000: use device pointer for phy creation
wilc_create_wiphy tries to get a pointer to a device from the
global wilc_sdio_func variable. This is a layering violation
and we can use the wilc_dev->dev pointer instead.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:01 +0000 (15:05 +0100)]
staging/wilc1000: unify device pointer
struct wilc has two pointers to store the device, one for sdio_func
and one for spi_device. By changing the pointer to a 'struct device',
we can simplify the logic and avoid a few #ifdefs.
Arnd Bergmann [Mon, 16 Nov 2015 14:05:00 +0000 (15:05 +0100)]
staging/wilc1000: move init/exit functions to driver files
The driver interfaces are in linux_wlan_sdio.c and linux_wlan_spi.c, so
this is where the init and exit functions should be. Splitting this up
enables further cleanups, including eventually allowing both modules
to be built together.
Arnd Bergmann [Mon, 16 Nov 2015 14:04:59 +0000 (15:04 +0100)]
staging/wilc1000: move wilc_wlan_inp_t into struct wilc
wilc_wlan_inp_t is an unnecessary indirection and requires linux_wlan.c
to have knowledge of the specific sdio and spi front-ends. This
removes the structure and places io_type directly inside the struct wilc.
The driver provides an interface for custom power management
and detection that is meant to be filled by people customizing
the driver. The default implementation of this is empty, and
we don't actually want people to have to modify the source code.
If anybody needs this, they need to describe the respective
hardware specifics using device tree or platform data and make
the driver handle this is a more general way.
Arnd Bergmann [Mon, 16 Nov 2015 14:04:57 +0000 (15:04 +0100)]
staging/wilc1000: avoid static definitions in header
The wilc_wfi_cfgoperations.h header defines the ieee80211_txrx_stypes
and cipher_suites variables that are only used in wilc_wfi_cfgoperations.c
and should not be shared in a header file.
This moves over all that data into the .c file, and also moves all
the macro definitions from the file that are also not needed here.
Arnd Bergmann [Mon, 16 Nov 2015 14:04:56 +0000 (15:04 +0100)]
staging/wilc1000: use NO_SECURITY instead of NO_ENCRYPT
The linux_wlan.c file uses a set of enums from wilc_wlan_if.h,
with the exception of the NO_ENCRYPT that comes from
wilc_wfi_cfgoperations.h. The two sets of enums clearly have
the same intention but are defined a bit different.
To prepare to clean up the ones in wilc_wfi_cfgoperations.h, this
first changes over the only other user.
Arnd Bergmann [Mon, 16 Nov 2015 14:04:54 +0000 (15:04 +0100)]
staging/wilc1000: use proper naming for global symbols
There are many global symbols in the wilc1000 driver, some of them
with names like "DEBUG_LEVEL" or "probe" that are not acceptable
for globals in the linux kernel as they may easily conflict with other
(equally broken) drivers.
This renames all the globals that do not already start with
wilc or a variation of that to start with wilc_ and to follow
the usual naming conventions.
Arnd Bergmann [Mon, 16 Nov 2015 14:04:53 +0000 (15:04 +0100)]
staging/wilc1000: make symbols static if possible
All symbols that are only referenced in the file that defines
them can be declared 'static' to avoid namespace pollution,
to produce better object code, and to make the source more
readable.
This patch removes host_int_get_rx_power_level function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere in this driver so just
remove it.
This patch removes host_int_get_assoc_req_info function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere in this driver so just
remove it.
This patch removes host_int_disconnect_station function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere so just remove it.
This patch removes host_int_get_start_scan_req function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere in this driver so just
remove it.
This patch removes host_int_set_start_scan_req function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere in this driver so that
just remove it.
This patch removes host_int_get_RSNAConfigPSKPassPhrase function
definition and declaration that is defined at host_interface.c and
host_interface.h. This function is defined but not used anywhere in this
driver so just remove it.
This patch removes host_int_set_RSNAConfigPSKPassPhrase function
definition and declaration that is defined at host_interface.c and
host_interface.h. This function is defined but not used anywhere in this
driver so just remove it.
Chaehyun Lim [Sun, 8 Nov 2015 07:49:18 +0000 (16:49 +0900)]
staging: wilc1000: remove host_int_get_pmkid_info
This patch removes host_int_get_pmkid_info function definition and
declaration that is defined at host_interface.c and host_interface.h.
This function is defined but not used anywhere in this driver so just
remove it.
This patch removes host_int_add_tx_gtk declaration that is defined in
host_interface.h file. It can not find any host_int_add_tx_gtk
function definition in this driver so just remove it.
Chaehyun Lim [Sun, 8 Nov 2015 07:49:15 +0000 (16:49 +0900)]
staging: wilc1000: rename u8KeyLen in host_int_add_rx_gtk
This patch changes u8KeyLen to key_len to avoid camelcase.
It is used as local variable in order to save gtk_key_len that is
argument of this function.
Chaehyun Lim [Sun, 8 Nov 2015 07:49:06 +0000 (16:49 +0900)]
staging: wilc1000: fix argument name of host_int_add_rx_gtk
This patch changes struct host_if_drv of host_int_add_rx_gtk function
declaration from hWFIDrv to hif_drv.
With this change, first argument of this function declaration and
definition has same name as hif_drv.
Chaehyun Lim [Sun, 8 Nov 2015 07:49:05 +0000 (16:49 +0900)]
staging: wilc1000: fix return type of host_int_add_rx_gtk
This patch changes return type of host_int_add_rx_gtk 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.
Chaehyun Lim [Sun, 8 Nov 2015 07:49:03 +0000 (16:49 +0900)]
staging: wilc1000: rename u8KeyLen in host_int_add_ptk
This patch changes u8KeyLen to key_len to avoid camelcase.
It is used as local variable in order to save pkt_key_len that is
argument of this function.