summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mwifiex/sta_ioctl.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-05mwifiex: check wait_event_interruptible return valueBing Zhao1-11/+10
wait_event_interruptible function returns -ERESTARTSYS if it's interrupted by a signal. Driver should check the return value and handle this case properly. In mwifiex_wait_queue_complete() routine, as we are now checking wait_event_interruptible return value, the condition check is not required. Also, we have removed mwifiex_cancel_pending_ioctl() call to avoid a chance of sending second command to FW by other path as soon as we clear current command node. FW can not handle two commands simultaneously. Cc: "3.6+" <stable@vger.kernel.org> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-06Merge branch 'for-john' of ↵John W. Linville1-8/+25
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/mwifiex/sta_ioctl.c net/mac80211/scan.c
2012-11-30wireless: mwifiex: Fix typo in wireless/mwifiex driverMasanari Iida1-1/+1
Correct spelling typo in wireless/mwifiex driver. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-30mwifiex: fix struct member mismatchJohannes Berg1-2/+3
Using bss->information_elements and treating bss->len_beacon_ies as its size is wrong, the real size is len_information_elements. Found while I was reviewing the use of this cfg80211 API (as it is actually potentially broken due to races.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-30cfg80211: fix BSS struct IE access racesJohannes Berg1-9/+26
When a BSS struct is updated, the IEs are currently overwritten or freed. This can lead to races if some other CPU is accessing the BSS struct and using the IEs concurrently. Fix this by always allocating the IEs in a new struct that holds the data and length and protecting access to this new struct with RCU. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-26Merge branch 'for-john' of ↵John W. Linville1-2/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2012-11-26cfg80211: remove remain-on-channel channel typeJohannes Berg1-2/+1
As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-14mwifiex: add multi-queue supportAvinash Patil1-4/+2
This patch adds support for multiple TX queues inside mwifiex driver. Four different queues according to WMM access categories are defined for each virtual interface. When a packet is received from netdev for transmission, tx pending count for particular queue is incremented and if tx pending count has reached upper water-mark, this queue is stopped instead of stopping all queues. Similarly when a packet is successfully transmitted from device, tx pending count is decremented per queue and if pending count falls below lower water-mark, queue operations are again resumed. This ensures that not all tranmission is blocked if traffic with particular TOS value suddenly increases. Also wake all queues after association/IBSS_join/uAP_BSS_start to enable traffic on all queues. 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>
2012-10-18wireless: drivers: make use of WLAN_EID_VENDOR_SPECIFICArend van Spriel1-2/+2
The include file linux/ieee80211.h contains three definitions for the same thing in enum ieee80211_eid due to historic changes: /* Information Element IDs */ enum ieee80211_eid { : WLAN_EID_WPA = 221, WLAN_EID_GENERIC = 221, WLAN_EID_VENDOR_SPECIFIC = 221, : }; The standard refers to this as "vendor specific" element so the other two definitions are better not used. This patch changes the wireless drivers to use one definition, ie. WLAN_EID_VENDOR_SPECIFIC. Cc: Jouni Malinen <j@w1.fi> Cc: Dan Williams <dcbw@redhat.com> Cc: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath6kl] Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex] Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> [ipw2x00] Signed-off-by: Arend van Spriel <arend@broadcom.com> [change libipw as well] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-09-28mwifiex: add support for P2P GO in interface type changeStone Piao1-0/+30
When cfg80211 calls to change interface type for P2P GO, send P2P mode config commands to firmware and set bss role and bss mode accordingly. Signed-off-by: Stone Piao <piaoyun@marvell.com> 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>
2012-09-28mwifiex: implement remain_on_channel and cancel_remain_on_channelStone Piao1-0/+29
Add a new command to implement remain_on_channel and cancel_remain_on_channel. Signed-off-by: Stone Piao <piaoyun@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>
2012-09-24mwifiex: disconnect the device before entering suspend stateAmitkumar Karwar1-0/+13
By default, device is disconnected before entering suspend state. User can keep the connection alive by using module parameter "disconect_on_suspend=0". 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>
2012-09-11mwifiex: use country ie of requested AP while associatingAmitkumar Karwar1-0/+40
AP's country ie is parsed and 11d information is updated in firmware while associating. Previous mwifiex_send_domain_info_cmd_fw() call in association path is not necessary now. Hence it is removed 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>
2012-08-06mwifiex: pass key_params pointer in mwifiex_set_encodeYing Luo1-3/+9
'cipher' and 'seq' coming from cfg80211 add_key handler will be parsed in mwifiex_set_encode() to handle AES_CMAC cipher suite. Signed-off-by: Ying Luo <luoy@marvell.com> Signed-off-by: Stone Piao <piaoyun@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17mwifiex: remove unnecessary code in data rate configurationAmitkumar Karwar1-117/+7
1) Remove unnecessary wrapper functions. 2) Currently we don't have command to set Tx data rate, so mwifiex_rate_ioctl_set_rate_value() function and related code can be removed. 3) "ds_rate" filled by mwifiex_ret_tx_rate_cfg() is never used. 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>
2012-07-17mwifiex: remove redundant code in set channel pathAmitkumar Karwar1-163/+0
1) Recently we removed set_channel cfg80211 handler. Also, cfg80211 blocks ibss connection requests if ibss network is already started /joined. Hence the code to restart ibss network in new channel (mwifiex_drv_change_adhoc_chan() function) becomes redundant. 2) mwifiex_bss_set_channel() function is redundant. It does some error checking and calculate adhoc start band and adhoc channel. Cfg80211 already takes care of error checking and provides correct channel information to the driver. Adhoc start band is already calculated in mwifiex_set_rf_channel() function. Other associated code is also removed 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>
2012-06-28mwifiex: wakeup main thread to handle command queuedAmitkumar Karwar1-3/+0
We miss to wakeup main thread after adding command to cmd pending queue at follwing places. These commands are handled later when main thread is woken up for handling an interrupt for sleep event from firmware. This adds worst case delay of 50msec. 1) We don't wakeup main thread when asynchronous command is added to cmd pending queue. Move queue_work() call from mwifiex_wait_queue_complete() to mwifiex_send_cmd_async() to wakeup main thread for sync as well as async commands. 2) Scan operation is triggered due to following reasons a) request from user (ex. "iw scan" command) b) Scan performed by driver internally. In first case main thread is woken up when first scan command is queued in cmd pending queue (we don't need to wakeup main thread for subsequent scan commands, because they are queued in scan command response handler), but it is not done for second case. queue_work() is moved inside mwifiex_scan_networks() to handle both the cases. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> 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>
2012-05-16mwifiex: append peer mac address TLV in key material command to firmwareAvinash Patil1-1/+6
Modify key related cfg80211 handlers to copy peer mac address for pairwise keys. If peer mac address is not present or group keys, it will be sent as broadcast mac address. This would be required since hostapd downloads per peer PTK. 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>
2012-05-16mwifiex: save adapter pointer in wiphy_privAvinash Patil1-1/+1
Since wiphy structure is per adapter we would save adapter, instead of mwifiex private pointer, in wiphy_priv. Also move country_info from mwifiex_private to mwifiex_adapter as making it part of mwifiex_adapter looks logical. 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>
2012-04-17mwifiex: corrections in timestamp related codeAmitkumar Karwar1-1/+4
We get two timing related fields for each bss from firmware in scan results. 1) timestamp - Actual timestamp information in probe response/beacon 2) network_tsf - firmware's TSF value at the time the beacon or probe response was received. Both are needed while associating by firmware. The patch takes care of following things. 1) We should pass "timestamp" to cfg80211_inform_bss(), but currently "network_tsf" is being provided. This error is corrected here. 2) Rename "network_tsf" to "fw_tsf" 3) Make use of u64 variable instead of an array of u8/u32 to save parsed "timestamp" information. 4) Use timestamp provided to stack in scan results using cfg80211_inform_bss() while associating. (bss->tsf) 5) Allocate space to save fw_tsf in "priv" of cfg80211_bss and retrieve it while associating. 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>
2012-04-17mwifiex: code cleanup in BSS handlingAmitkumar Karwar1-28/+19
Rearrange some code to save extra parameters to the functions. 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>
2012-04-12mwifiex: add support for WPS2.0Avinash Patil1-0/+34
This patches enables setting association request and probe request IE for station interface. WPS exchange between WPS2.0 AP and mwifiex STA Enrollee/External Registrar completes successfully. Tested with wpa_supplicant 1.0 and 2.0 devel. 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>
2012-04-12mwifiex: display correct country information in debugfs "info"Amitkumar Karwar1-1/+2
Use "priv->country_code" string to display country information in debugfs command "info" instead of "adapter->region_code". "adapter->region_code" contains default region code got from FW while initialization, whereas "priv->country_code" is updated in reg_notifier handler whenever there is a change in regulatory domain. 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>
2012-04-10mwifiex: remove redundant signal handling codeAmitkumar Karwar1-33/+0
1) The wrapper function mwifiex_get_signal_info() is unnecessary. 2) As noise and signal vaules in private structure already get modified, we don't need to explicitly pass "struct mwifiex_ds_get_signal" to get it filled. 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>
2012-03-14mwifiex: correction in structure name passed to sizeof()Amitkumar Karwar1-1/+1
"hscfg" is declared as struct mwifiex_ds_hs_cfg. Use same structure name for calculating it's size. 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>
2012-03-14mwifiex: fix checkpatch --strict warnings/errors Part 8Yogesh Ashok Powar1-51/+51
For files sta_event.c and sta_ioctl.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>
2012-03-13mwifiex: merge functions to derive cfp by chan & freq in oneYogesh Ashok Powar1-8/+5
There exist different functions with very long names to derive the channel frequency and power tripplet based on band and channel/freq. 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>
2012-03-06mwifiex: endian bug in mwifiex_drv_change_adhoc_chan()Dan Carpenter1-2/+2
In mwifiex_drv_change_adhoc_chan() we pass channel to mwifiex_bss_ioctl_ibss_channel() which sets the high 16 bits. This works on little endian systems but not on big endian ones. I've changed mwifiex_drv_change_adhoc_chan() to use a 16 bit variable. This matches the other functions in the file. I considered changing mwifiex_change_adhoc_chan() as well but it turns out that the function isn't implemented so I just removed the definition. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-06mwifiex: remove unnecessary struct mwifiex_802_11_ssidAmitkumar Karwar1-3/+2
Use struct cfg80211_ssid available in include/net/cfg80211.h instead of having similar definition in driver. 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>
2012-03-06mwifiex: handle auto authentication mode correctlyAmitkumar Karwar1-0/+11
When authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC, driver tries to connect using open mode. The association is failed if AP is configured in shared mode. This patch adds code to try association using shared mode as well if open mode association fails. Now since we returned exact error code in association response handler (instead of -1), corresponding changes are done in mwifiex_process_cmdresp(). 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>
2012-02-29mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUSAmitkumar Karwar1-5/+5
Instead of defining an 'enum', we can simply use 'u8' flag for WEP status. Rename 'wep_status' to 'wep_enabled' to match with 'wpa_enabled' and 'wpa2_enabled'. 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>
2012-02-03mwifiex: handle association failure case correctlyAmitkumar Karwar1-1/+7
Currently even if association is failed "iw link" shows some information about connected BSS and "Tx timeout" error is seen in dmesg log. This patch fixes below issues in the code to handle assoc failure case correctly. 1) "status" variable in mwifiex_wait_queue_complete() is not correctly updated. Hence driver doesn't inform cfg80211 stack about association failure. 2) During association network queues are stopped but carrier is not cleared, which gives Tx timeout error in failure case 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>
2012-01-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-1/+6
2012-01-03mwifiex: fix crash during simultaneous scan and connectAmitkumar Karwar1-1/+6
If 'iw connect' command is fired when driver is already busy in serving 'iw scan' command, ssid specific scan operation for connect is skipped. In this case cmd wait queue handler gets called with no command in queue (i.e. adapter->cmd_queued = NULL). This patch adds a NULL check in mwifiex_wait_queue_complete() routine to fix crash observed during simultaneous scan and assoc operations. 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-12-22mwifiex: remove redundant band config codeAmitkumar Karwar1-61/+0
struct mwifiex_ds_band_cfg and mwifiex_set_radio_band_cfg() routine are unnecessary. It can be done with simple equivalant code. 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-12-14mwifiex: wakeup and stop multiple tx queues in net_deviceAvinash Patil1-2/+2
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>
2011-11-18mwifiex: add support for Marvell sd8797 deviceBing Zhao1-2/+2
This patch supports Marvell chipset 88W8797 (Avastar) with SDIO interface. The corresponding firmware image file is located at: "mrvl/sd8797_uapsta.bin" Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Tristan Xu <xurf@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@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>
2011-10-14mwifiex: fix make namespacecheck warningsAmitkumar Karwar1-2/+2
This patch takes care of warnings found by running 'make namespacecheck': 1. Remove dead code. 2. Reorder function definitions to avoid forward declarations. 3. Remove unnecessary function/structure declarations and mark them as static. 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-10-14mwifiex: use separate wait condition for each command nodeAmitkumar Karwar1-2/+4
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>
2011-10-12mwifiex: fix smatch errorsYogesh Ashok Powar1-1/+1
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>
2011-09-30mwifiex: remove unreachable codeAmitkumar Karwar1-44/+2
In disconnected state "iw dev mlan0 link" command will return from cfg80211 stack itself. We also have an error check in mwifiex_cfg80211_get_station() routine. Therefore the code under "if (!priv->media_connected)" condition in mwifiex_rate_ioctl_get_rate_value() routine becomes unreachable. 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-09-27mwifiex: pass correct band parameter to ieee80211_channel_to_frequency()Amitkumar Karwar1-2/+3
ieee80211_channel_to_frequency() routine expects band parameter in the form of "enum ieee80211_band band". Currently driver specific band (BAND_A, BAND_AN etc.) is passed to the routine. This patch makes sure that correct parameter 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-09-27mwifiex: update bss band informationAmitkumar Karwar1-2/+4
In recent commit "mwifiex: use cfg80211 dynamic scan..." (7c6fa2a843..) scan table handling in driver is removed to make use of cfg80211 dynamic scan table. Now driver sends beacon buffers found in scanning directly to stack and parse the buffer for requested BSS only during association. Beacon buffer doesn't contain bss band information. Driver gets it from firmware in separate tlv (chan_band_tlv). Currently since we don't inform stack about bss bandinfo, there is an issue with 5GHz association. Use "priv" field of struct cfg80211_bss to store bandinfo. This fixes 5GHz association issue. 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-09-22mwifiex: remove unneeded NULL checkDan Carpenter1-2/+2
We dereference "rate" on the lines before so the checks here are too late to help. This function is only called from mwifiex_dump_station_info() and "rate" is always a non-NULL pointer so the check can be removed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-22mwifiex: add a kfree() to an error pathDan Carpenter1-0/+1
We're not likely to hit this small memory leak, but lets fix it anyway to keep the static checkers happy. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-13mwifiex: replace kmalloc & memcpy sequence with kmemdupYogesh Ashok Powar1-4/+5
Sequence of kmalloc/kzalloc and memcpy is replaced with kmemdup. Cc: Walter Harms <wharms@bfs.de> 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-08-12mwifiex: use cfg80211 dynamic scan table and cfg80211_get_bss APIAmitkumar Karwar1-91/+109
Instead of maintaining static scan table in driver, scan list is sent to cfg80211 stack (after parsing each scan command response). In assoc handler (for infra and ibss network) requested BSS information is retrieved using cfg80211_get_bss() API. With the changes above some redundant code are removed. 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-08-08mwifiex: remove redundant variable scan_table_idxBing Zhao1-12/+0
mwifiex_get_bss_info() routine updates variable 'info->scan_table_idx' but it is never used. 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-08-08mwifiex: remove wireless.h inclusion and fix resulting bugsBing Zhao1-14/+4
replace IW_MAX_AP & IW_CUSTOM_MAX with local definitions and remove usage of struct iw_statistics. Cc: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-21mwifiex: disable auto deep sleep before unloading the driverAmitkumar Karwar1-0/+14
Since the auto deep sleep mode has been enabled at driver init time we should disable it at driver unloading to shutdown the function gracefully. 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>