summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex
AgeCommit message (Collapse)Author
2011-07-20wireless: mwifiex: print hw address via %pMAndy Shevchenko
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-13mwifiex: add cfg80211 handler for set_bitrate_maskYogesh Ashok Powar
Currently, setting only legacy bitrates on 2.4GHz band are supported. Mode 802.11b/g/bg is enabled based on bitrates selection. If only CCK bitrates selected then 802.11b mode is enabled. If only OFDM bitrates are selected then 802.11g mode is enabled. For both: CCK and OFDM rates 802.11bg mixed mode is enabled. 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>
2011-07-11mwifiex: 11n specific configuration for transmitAmitkumar Karwar
Currently device is not able to transmit in 40MHz in spite of enabling 40MHz support in HTCapInfo IE in assoc req, because 11n specific FW capabilities for transmission are not initialized. This patch adds code to initilize these capabilities. Signed-off-by: Amitkumar Karwar <akarwar@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>
2011-07-08mwifiex: 4-byte alignment in mwifiex_process_sta_txpd()Yogesh Ashok Powar
In XMIT path, the skb that we get from the kernel itself is not aligned with 4-byte boundary on some embedded platforms. Had it not been the presence of tx_pkt_offset field in txpd, 4 byte memory alignment was not possible without memmove of entire skb. And that would have increased MIPS instead of reducing. With this patch few memory cycles can be saved while fetching interface header and txpd structure because of 4 bytes memory alignment. Reported-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Tested-by: Philip Rakity <prakity@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-08mwifiex: fix minor issue in debugfs command 'info'Amitkumar Karwar
Debugfs command 'info' shows wrong interface type. The regression occurred due to commit eecd8250e (mwifiex: remove MWIFIEX_BSS_MODE_ macros) in which we replaced MWIFIEX_BSS_MODE_* macros by NL80211_IFTYPE_*, for example, MWIFIEX_BSS_MODE_IBSS (2) --> NL80211_IFTYPE_ADHOC (1) The issue is fixed by swapping static character array used to display interface type information. 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>
2011-07-08mwifiex: fix regression in WEP security modeAmitkumar Karwar
Htcapinfo is unnecessarily sent in assoc request in WEP security due to a regression introduced by commit 2be50b8df53 (mwifiex: remove redundant encryption_mode mapping). The issue is fixed in this patch. 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>
2011-07-06mwifiex: modify SDIO aggregation Tx/Rx buffer sizeAmitkumar Karwar
The SDIO aggregation buffer size has been modified to an optimum value which gives good throughput results. 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>
2011-06-28Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 Conflicts: drivers/net/wireless/iwlwifi/iwl-tx.c
2011-06-27mwifiex: restore handling of NULL parametersDan Carpenter
Prior to a5ffddb70c5cab "mwifiex: remove casts of void pointers" the code assumed that the data_buf parameter could be a NULL pointer. The patch preserved some NULL checks but not consistently, so there was a potential for NULL dereferences and it changed the behavior. This patch restores the original behavior. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-22mwifiex: remove casts of void pointersAmitkumar Karwar
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>
2011-06-15mwifiex: Fixing NULL pointer dereferenceYogesh Ashok Powar
Following OOPS was seen when booting with card inserted BUG: unable to handle kernel NULL pointer dereference at 0000004c IP: [<f8b7718c>] cfg80211_get_drvinfo+0x21/0x115 [cfg80211] *pde = 00000000 Oops: 0000 [#1] SMP Modules linked in: iwl3945 iwl_legacy mwifiex_sdio mac80211 11 sdhci_pci sdhci pl2303 'ethtool' on the mwifiex device returned this OOPS as wiphy_dev() returned NULL. Adding missing set_wiphy_dev() call to fix the problem. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-10mwifiex: get rid of global adapter pointerAmitkumar Karwar
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>
2011-06-07mwifiex: disable transmission buffer aggregation for AMSDU packetsYogesh Ashok Powar
Padding per MSDU will affect the length of next packet and hence the exact length of next packet is uncertain here. Also, aggregation of transmission buffer, while downloading the data to the card, wont gain much on the AMSDU packets as the AMSDU packets utilizes the transmission buffer space to the maximum (adapter->tx_buf_size). Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-07mwifiex: adding check for enough space before paddingYogesh Ashok Powar
All MSDUs, except the last one in an AMSDU, should end up at 4 bytes boundary. There is need to check if enough skb_tailroom space exists before padding the skb. Also re-arranging code for better readablity. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-07mwifiex: Remove redundant skb_queue_empty checksYogesh Ashok Powar
The check of skb list empty before calling skb_peek and skb_dequeue is redundant. These functions returns NULL if the list is empty. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-07mwifiex: remove list traversal in mwifiex_num_pkts_in_txqYogesh Ashok Powar
Instead of counting the number of packets in txq for particular RA list before AMSDU creation, maintain a counter which will keep track of the same. This will reduce some MIPS while generating AMSDU traffic as we only have to check the counter instead of traversing through skb list. Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-01mwifiex: remove support for old chipsets W0/W1Amitkumar Karwar
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>
2011-05-27Merge ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2011-05-26mwifiex: correct event header lengthYogesh Ashok Powar
While decoding received event packet from firmware, 4 bytes of interface header are already removed unconditionally. So for handling event only 4 more bytes needs to be pulled. This is achieved by changing event header length to 4. Almost all the events, except BA stream related and AMSDU aggregation control events, do not have the payload in their event skb. Such events handling depends only on the event ID. This event ID is the first four bytes of the event skb, which is copied to a separate variable before pulling the skb header. Hence event handling worked only for those events that didn't have payload in event skb. This patch fixes the broken event path of the events with payload in their event skb without harming existing working event path for the events without payload. 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>
2011-05-24Merge ↵John W. Linville
ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2011-05-19mwifiex: adjust high/low water marks for tx_pending queueMarc Yang
This is to fix an issue that the throughput of the higher priority stream gets dropped when a lower priority stream is present. Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19mwifiex: CPU mips optimization with NO_PKT_PRIO_TIDMarc Yang
If we go through the entire for loop in mwifiex_wmm_get_highest_priolist_ptr() and don't find any packets, set highest_queued_prio to NO_PKT_PRIO_TID (< LOW_PRIO_TID). Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19mwifiex: check mwifiex_wmm_lists_empty() before dequeueMarc Yang
add checks to mwifiex_wmm_process_tx() loop so it doesn't re-enter mwifiex_dequeue_tx_packet() to find it can't send. Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19mwifiex: reduce CPU usage by tracking highest_queued_prioMarc Yang
This patch adds highest_queued_prio to track priority of packets as they are enqueued so that mwifiex_wmm_get_highest_priolist_ptr() starts checking at the first level where we have packets, instead of the highest. The function also lowers priority value to the level where first packet is found. Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19mwifiex: reduce CPU usage by tracking tx_pkts_queuedMarc Yang
This patch adds tx_pkts_queued to track number of packets being enqueued & dequeued so that mwifiex_wmm_lists_empty() evaluation is lightweight. Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-16Merge branch 'master' of ↵John W. Linville
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
2011-05-16mwifiex: use ieee80211_amsdu_to_8023s routineYogesh Ashok Powar
mwifiex was using its own implementation of converting 802.11n AMSDU to 802.3s. This patch removes mwifiex specific implementation and uses existing ieee80211_amsdu_to_8023s routine. 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>
2011-05-12mwifiex: remove mwifiex_recv_complete functionAmitkumar Karwar
The function - increments dropped rx_packet count if status code passed to it is "-1". - frees SKB buffer. But currently the function is being called with "0" status code. This patch replaces above function by dev_kfree_skb_any() call. 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>
2011-05-11mwifiex: cleanup ioctl.hBing Zhao
Some structures and macros in ioctl.h are redundant or no longer used. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-11mwifiex: remove redundant local structuresAmitkumar Karwar
Avoid use of local structure in the function if the structure is already allocated by the caller and the structure pointer is passed. 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>
2011-05-10mwifiex: remove unnecessary struct mwifiex_opt_sleep_confirm_bufferAmitkumar Karwar
The structure definition is struct mwifiex_opt_sleep_confirm_buffer { u8 hdr[4]; struct mwifiex_opt_sleep_confirm ps_cfm_sleep; } __packed; For sleep_confirm command we already reserve 4 bytes (using skb_reserve()) for an interface header. It will be filled later by interface specific code. We don't need "hdr[4]" element in above structure. So we can use "struct mwifiex_opt_sleep_confirm" directly instead of "struct mwifiex_opt_sleep_confirm_buffer". 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>
2011-05-10mwifiex: fix null derefs, mem leaks and triviaChristoph Fritz
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>
2011-05-05Merge branch 'for-davem' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
2011-05-05mwifiex: remove unnecessary variable initializationYogesh Ashok Powar
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>
2011-05-05mwifiex: fix simultaneous assoc and scan issueAmitkumar Karwar
When scan and assoc (infra/ibss) commands are simultaneously given in two terminals, association response is erroneously served while serving the scan response. mwifiex_cfg80211_results() is the common routine for sending ioctl (scan, assoc etc.) results to cfg80211 stack. In above scenario even if the common routine is called for scan ioctl context, it also tries to send information about assoc ioctl to cfg80211 because "priv->assoc_request/priv->ibss_join_request" flag is on at that time. Fix the issue by updating request variable after assoc handling and modifying the variable check in mwifiex_cfg80211_results. 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>
2011-05-05net: call dev_alloc_name from register_netdeviceJiri Pirko
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>
2011-05-02mwifiex: fix missing tsf_val TLVBing Zhao
In mwifiex_cmd_append_tsf_tlv(), two tsf_val TLVs should be filled in the buffer and then sent to firmware. The missing first TLV for tsf_val is added back in this patch. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-29mwifiex: fix copy-n-paste 'thinko' for tsf_valJohn W. Linville
CC [M] drivers/net/wireless/mwifiex/join.o drivers/net/wireless/mwifiex/join.c: In function ‘mwifiex_cmd_802_11_associate’: drivers/net/wireless/mwifiex/join.c:119:8: warning: ‘tsf_val’ may be used uninitialized in this function drivers/net/wireless/mwifiex/join.c:103:12: note: ‘tsf_val’ was declared here Looks like a copy-n-paste error, identical lines are a few lines below the ones removed, with an actual memcpy to tsf_val in between... Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-28mwifiex: fix bug in mwifiex_save_curr_bcn()Amitkumar Karwar
Since timestamp in beacon buffer keeps changing all the time, the memcmp check in mwifiex_save_curr_bcn() is redundant. Remove that memcmp check and also avoid freeing and allocation of buffer if required beacon buffer size is same as previous one. 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>
2011-04-28mwifiex: HT capability information handlingAmitkumar Karwar
1) Initialise HT capabilities in cfg80211 properly. 2) Cfg80211 stack may modify "sband->ht_cap" to disable 40Mhz operation in 2.4GHz band (after recent patch "cfg80211: module_param to disable HT40 in 2.4GHz band") Therefore read "sband->ht_cap" instead of an adapter variable "hw_dot_11n_dev_cap" to get HT capabilities. 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>
2011-04-28mwifiex: check firmware capabilities while initialising 5GHz band parametersAmitkumar Karwar
There are some SD8787 cards which don't support 5GHz band. Therefore initialise 5GHz band parameters only if hardware supports the band. 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>
2011-04-19mwifiex: optimize driver initialization codeAmitkumar Karwar
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>
2011-04-19mwifiex: remove some macro definitionsAmitkumar Karwar
use corresponding macros defined in include/linux/ieee80211.h 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>
2011-04-19mwifiex: remove redundant local variables and commentsYogesh Ashok Powar
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>
2011-04-14mwifiex: rename function mwifiex_is_ba_stream_availBing Zhao
The old function name sounds like checking for existing BA stream. The function actually checks if we have room for creating new BA stream or not. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-14mwifiex: remove unused function parametersAmitkumar Karwar
Some function parameters become useless after previous cleanup changes. 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>
2011-04-14mwifiex: remove redundant "return" at end of void functionYogesh Ashok Powar
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>
2011-04-14mwifiex: cleanup ioctl wait queue and abstraction layerAmitkumar Karwar
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>
2011-04-12mwifiex: use common keyinfo bitmap for different key typesYogesh Ashok Powar
Instead of having separate key information definitions for each type of key, a common key information bitmap is used. 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>
2011-04-12mwifiex: fix cmd_skb headroom decreasing issueBing Zhao
Before calling host_to_card() to send the cmd to firmware, we use skb_push() to add 4 bytes SDIO interface header at the start of the data buffer. Since cmd_skb data structure will be re-used at a later time, we need to restore its headroom by removing the 4 bytes header. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marc Yang <yangyang@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>