summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/main.c
Commit message (Collapse)AuthorAgeFilesLines
...
* mwifiex: improve scan delay logic during Tx trafficAmitkumar Karwar2012-08-061-0/+3
| | | | | | | | | | | | | | | | | Earlier scan command was postponed by 20msec multiple times to give preference to Tx traffic until we find empty wmm queue. There is a corner case in which wmm queue becomes empty immediately after processing the packet(before 20msec) and there may be next packet coming after some time. In this case we should not resume scan operation. We will use new flag to check Tx traffic and resume scan operation only if there is no traffic for 200msec. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* cfg80211: use wireless_dev for interface managementJohannes Berg2012-07-121-2/+2
| | | | | | | | In order to be able to create P2P Device wdevs, move the virtual interface management over to wireless_dev structures. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mwifiex: wake up main thread to handle Tx traffic if scan is delayed/abortedAmitkumar Karwar2012-06-221-1/+2
| | | | | | | | | | | | | | | | | | | | | This is a flaw in recently implemented logic to handle Tx traffic and scan operation simultaneously. We missed to wakeup main thread to handle Tx traffic if scan is delayed/aborted. For some cards (SD8797, for example), firmware will send SLEEP event if there is no activity for 50msec. While handling the SLEEP event, main thread will be woken up and Tx packet gets sent hence. In worst case Tx traffic will be delayed for 50msec. For other cards, such as USB8797, firmware won't send SLEEP event. So, Tx traffic gets stuck if no other event triggers the wakeup of main thread. This patch fixes above issues. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: fix simultaneous scan and Tx traffic problemAmitkumar Karwar2012-06-111-2/+2
| | | | | | | | | | | | | | | | | | | If scan operation is started when Tx traffic is already running, driver locks Tx queue until it gets completed. With this logic there is a delay for Tx packets. This patch implements new approach to give Tx path higher priority in this case. Driver internally sends multiple synchronous scan commands to firmware when scan is requested by user. Now we will make sure that Tx queue is empty everytime before sending next scan command. If Tx queue isn't empty scan command will be postponsed by 20msec. This rule will be followed until Tx queue becomes empty or timeout of 1 second happens. In case of timeout scan operation will be aborted. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: retrieve IEs from cfg80211_beacon_data and send to firmwareAvinash Patil2012-05-161-0/+4
| | | | | | | | | | | | | This patch adds logic for setting tail beacon IE, probe response IE and assoc response IE from cfg80211_ap_settings parameter of start_ap handler into FW. RSN IE is also retrieved from tail IE buffer and sent to firmware. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: add custom IE frameworkAvinash Patil2012-05-161-0/+2
| | | | | | | | | | | | | 1. support for setting custom IE from application hostapd etc. Custom IE addition using auto-indexing and Custom IE deletion using static indices (which are allocated during IE addition and stored in driver) are supported. 2. Separate file for handling IE related execution. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: support for creation of AP interfaceAvinash Patil2012-05-161-6/+12
| | | | | | | | | | | | | | | | 1. wiphy structure is per device; hence moved it to mwifiex_adapter mwifiex_register_cfg80211 takes mwifiex_adapter as parameter. This function only registers wiphy with cfg80211. 2. Creation of interfaces is moved to cfg80211 add_virtual_interface handler. 3. Create 2 interfaces by default: station and AP Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: allocate space for one more mwifiex_private structureAvinash Patil2012-05-161-15/+18
| | | | | | | | | | | Reserve space for one more priv structure. This will be used by AP interface. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: add support for Marvell USB8797 chipsetAmitkumar Karwar2012-04-231-6/+20
| | | | | | | | | | | | | This patch supports Avastar 88W8797 chipset with USB interface. The corresponding firmware image file is located at: "mrvl/usb8797_uapsta.bin" Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Frank Huang <frankh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: use asynchronous firmware loadingAmitkumar Karwar2012-04-121-48/+55
| | | | | | | | | | | Make use of request_firmware_nowait instead of request_firmware to load FW asynchronously. This fixes timeouts introduced with recent udev changes. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless, mwifiex: drop redundant NULL test before call to release_firmware()Jesper Juhl2012-04-121-2/+1
| | | | | | | | | Since release_firmware() does its own test for NULL it is redundant to do so before calling it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: fix checkpatch --strict warnings/errors Part 4Yogesh Ashok Powar2012-03-141-25/+24
| | | | | | | | For files main.c, main.h and pcie.c Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-02-151-4/+8
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: net/mac80211/debugfs_sta.c net/mac80211/sta_info.h
| * mwifiex: add NULL checks in driver unload pathAmitkumar Karwar2012-02-061-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | If driver load is failed, sometimes few pointers may remain uninitialized ex. priv->wdev, priv->netdev, adapter->sleep_cfm This will cause NULL pointer dereferance while unloading the driver. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mwifiex: pass priv pointer instead of adapterAvinash Patil2012-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | Pass mwifiex_private pointer directly to wmm_add_buf_txqueue() instead of passing adapter and then deriving priv again in mwifiex_get_priv_by_id(). This reduces a 'for' loop in TX path. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mwifiex: use bss_type and bss_num to retrieve privYogesh Ashok Powar2012-01-241-17/+6
|/ | | | | | | | | | | | | | Current implementation, for retrieving priv from adapter, uses bss_index. In multi interface environment supporting different types, bss_index may not be unique. Use bss_type along with bss_num to retrieve the priv. bss_index is removed with this change. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: remove cfg_workqueueAmitkumar Karwar2011-12-141-2/+0
| | | | | | | | | | | | | | | | | | | | | | | cfg_workqueue was added to notify cfg80211 that scan, connect or disconnect is done by calling respective completion handlers. We can avoid use of this workqueue by calling those handlers from other places. 1) Call connect, disconnect completion handlers in their callback functions. ex. Call cfg80211_connect_result() in mwifiex_cfg80211_connect() 2) Call scan completion handler after parsing response of last scan command in a queue. After removing the workqueue, variables (assoc_request etc.) and checks used for mutual exclusion become redundant. Those are also removed in this patch. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: wakeup and stop multiple tx queues in net_deviceAvinash Patil2011-12-131-5/+6
| | | | | | | | | | replace single queue function calls with equivalent multiple queue functions. Wakeup queue and stop queue calls are guarded by spin lock. Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2011-10-171-2/+8
|\ | | | | | | git://git.infradead.org/users/linville/wireless-next into for-davem
| * mwifiex: use separate wait condition for each command nodeAmitkumar Karwar2011-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently global wait condition (adapter->cmd_wait_q.condition) is used while sending synchronous commands to FW. When two threads enter in mwifiex_send_cmd_sync() routine at the same time, both the threads wait for their command responses. Since wait condition is same for both, they wake up simultaneously after getting response of 1st command. After this when a thread is waiting for command response of 3rd command, it wakes up after getting response of 2nd command and so on. Therefore we don't wait for the response of last command(0xaa) during unload. Hence while next time loading the driver command time out is seen for INIT command. This problem is resolved by having separate wait condition flag for each command(except scan command). Since scan command is treated differently (by maintaining scan pending q etc.), newly defined flag (scan_wait_q_woken) is used as a scan wait condition. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwifiex: add support for Marvell pcie8766 chipsetAmitkumar Karwar2011-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch supports 88W8766P chipset with a PCIe interface. The corresponding firmware image file is located at: "mrvl/pcie8766_uapsta.bin" Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Ramesh Radhakrishnan <rramesh@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Frank Huang <frankh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwifiex: fix smatch errorsYogesh Ashok Powar2011-10-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52) error: potential null derefence 'priv'. drivers/net/wireless/mwifiex/main.c +828 mwifiex_remove_card(52) error: we previously assumed 'priv' could be null (see line 820) drivers/net/wireless/mwifiex/txrx.c +90 mwifiex_process_tx(24) error: potential null derefence 'local_tx_pd'. drivers/net/wireless/mwifiex/sta_ioctl.c +766 mwifiex_rate_ioctl_set_rate_value(30) error: buffer overflow 'rate' 14 <= 14 Cc: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' of ↵John W. Linville2011-10-111-213/+53
|\ \ | |/ | | | | | | | | | | git://git.infradead.org/users/linville/wireless-next into for-davem Conflicts: Documentation/feature-removal-schedule.txt
| * mwifiex: handle an error path correctlyAmitkumar Karwar2011-10-031-4/+1
| | | | | | | | | | | | | | | | | | | | | | In failure case locks are not allocated in mwifiex_register(). So mwifiex_free_lock_list() routine call becomes redundant. Also we don't need to check return type for mwifiex_init_lock_list() routine. It never fails. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwifiex: add cfg80211 handlers add/del_virtual_intfYogesh Ashok Powar2011-09-301-210/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | Making adding and deleting virtual interfaces dynamic. Adding handlers for creating and deleting virtual interface with given name and dev respectively. Also, creating default interface of type station on insmod of the driver. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' of ↵John W. Linville2011-08-221-0/+4
|\ \ | |/ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c drivers/staging/ath6kl/os/linux/ar6000_drv.c
| * mwifiex: print driver version informationAmitkumar Karwar2011-08-091-0/+4
| | | | | | | | | | | | | | | | | | | | Add code to display driver version information in dmesg after loading the driver successfully. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | net: remove use of ndo_set_multicast_list in driversJiri Pirko2011-08-171-1/+1
|/ | | | | | | replace it by ndo_set_rx_mode Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mwifiex: remove casts of void pointersAmitkumar Karwar2011-06-221-1/+1
| | | | | | | | | | | | | | | In some cases local pointers are used to cast void pointers passed to the function. Those unnecessary local pointers are also removed. This patch was inspired by Joe Perches' patch [PATCH net-next 1/2] wireless: Remove casts of void *; and the comments from Julian Calaby. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Cc: Joe Perches <joe@perches.com> Cc: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: get rid of global adapter pointerAmitkumar Karwar2011-06-101-10/+6
| | | | | | | | | | | | | | | | | 1) Avoid global adapter pointer usage a) in sdio.c by moving some code from mwifiex_cleanup_module() to mwifiex_sdio_remove(). b) in main.c by passing an extra parameter to few functions. 2) Add new variable "user_rmmod" to identify if mwifiex_sdio_remove() callback function is called in card removal or rmmod context. These code changes are adapted from Libertas driver. 3) Remove unnecessary NULL pointer check for "func" pointer in mwifiex_sdio_remove(). Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: remove support for old chipsets W0/W1Amitkumar Karwar2011-06-011-16/+2
| | | | | | | | | | | | | | For SD8787 A0/A1 chipsets we use the default firmware image file 'mrvl/sd8787_uapsta.bin'. So the chip rev id variable is removed. The global variable fw_name is moved to adapter structure so that we can support a different interface, such as PCIe, in future. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2011-05-161-14/+13
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-agn-tx.c net/mac80211/sta_info.h
| * mwifiex: fix null derefs, mem leaks and triviaChristoph Fritz2011-05-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch: - adds kfree() where necessary - prevents potential null dereferences - makes use of kfree_skb() - replaces -1 for failed kzallocs with -ENOMEM Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Reviewed-by: Kiran Divekar <dkiran@marvell.com> Tested-by: Amitkumar Karwar <akarwar@marvell.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwifiex: remove unnecessary variable initializationYogesh Ashok Powar2011-05-051-10/+9
| | | | | | | | | | | | | | | | | | Skip initialization of local variables with some default values if the values are not going to be used further down the code path. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | net: call dev_alloc_name from register_netdeviceJiri Pirko2011-05-051-4/+0
|/ | | | | | | | | | | | | | Force dev_alloc_name() to be called from register_netdevice() by dev_get_valid_name(). That allows to remove multiple explicit dev_alloc_name() calls. The possibility to call dev_alloc_name in advance remains. This also fixes veth creation regresion caused by 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mwifiex: optimize driver initialization codeAmitkumar Karwar2011-04-191-54/+27
| | | | | | | | | | | | 1) removal of unnecessary mwifiex_device structure 2) avoid passing adapter pointer to mwifiex_init_sw() 3) remove local variable drv_mode_info in mwifiex_add_card() 4) type change in mwifiex_bss_attr to match mwifiex_private 5) removal of more wordy comments Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: remove redundant local variables and commentsYogesh Ashok Powar2011-04-191-13/+6
| | | | | | | | | | | Remove some local variables (mainly function return values) that are used only once. Also, one dummy function and some wordy comments are removed. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: remove redundant "return" at end of void functionYogesh Ashok Powar2011-04-141-3/+0
| | | | | | | | | The return statement at the last line of a void function is not necessary. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mwifiex: cleanup ioctl wait queue and abstraction layerAmitkumar Karwar2011-04-141-38/+33
| | | | | | | | | | | | | | | | 1) remove mwifiex_alloc_fill_wait_queue() and mwifiex_request_ioctl() 2) avoid dynamic allocation of wait queue 3) remove unnecessary mwifiex_error_code macros that were used mainly by the wait queue status code 4) remove some abstraction functions 5) split mwifiex_prepare_cmd() to mwifiex_send_cmd_async() and mwifiex_send_sync() to handle asynchronous and synchronous commands respectively Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless: mwifiex: initial commit for Marvell mwifiex driverBing Zhao2011-03-301-0/+1102
This driver adds WiFi support for Marvell 802.11n based chipsets with SDIO interface. Currently only SD8787 is supported. More chipsets will be supported later. drivers/net/wireless/mwifiex/ Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Ramesh Radhakrishnan <rramesh@marvell.com> Signed-off-by: Frank Huang <frankh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud