aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712/os_intfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-09 13:52:18 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-09 13:52:18 -0800
commitb05ee6bf9e6c7acc38dca1466b63bb24ae5df6f3 (patch)
tree434afa78fbfa784591d45a9befbaed247b26ae89 /drivers/staging/rtl8712/os_intfs.c
parentMerge tag 'driver-core-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core (diff)
parentstaging: pohmelfs: remove drivers/staging/pohmelfs (diff)
downloadlinux-dev-b05ee6bf9e6c7acc38dca1466b63bb24ae5df6f3.tar.xz
linux-dev-b05ee6bf9e6c7acc38dca1466b63bb24ae5df6f3.zip
Merge tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Staging tree patches for 3.3-rc3 Big things here is the deletion of the Android pmem driver, as it's obsolete and no one uses it, the gma500 driver as it's already in the drm portion of the kernel tree, and the pohmelfs filesystem as it's obsolete and a rewritten version is being proposed for the fs/ section of the kernel. Other than that, a smattering of different bugfixes and regressions, and some omap drm api merge fixups that were needed due to api changes in the main portion of the drm tree, allowing this code to build properly again. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> * tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (28 commits) staging: pohmelfs: remove drivers/staging/pohmelfs staging: android/ram_console: Don't build on arches w/o ioremap staging: r8712u: Use asynchronous firmware loading staging: usbip: fix to prevent potentially using uninitialized spinlock staging: r8712u: Fix problem when CONFIG_R8712_AP is set staging: tidspbridge: fix incorrect free to drv_datap staging: tidspbridge: fix bridge_open memory leaks staging: android: lowmemorykiller: Don't wait more than one second for a process to die MAINTAINERS: staging: iio: add iio information staging: zcache: fix serialization bug in zv stats staging: fix go7007-usb license Staging: android: binder: Fix crashes when sharing a binder file between processes Staging: android: Remove pmem driver Staging: asus_oled: fix NULL-ptr crash on unloading Staging: asus_oled: fix image processing Staging: android: binder: Don't call dump_stack in binder_vma_open staging: r8712u: Add new Sitecom UsB ID zcache: Set SWIZ_BITS to 8 to reduce tmem bucket lock contention. zcache: fix deadlock condition staging: drm/omap: fix locking issue ...
Diffstat (limited to 'drivers/staging/rtl8712/os_intfs.c')
-rw-r--r--drivers/staging/rtl8712/os_intfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index 9a75c6dbe505..98a3d684f9b2 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -31,6 +31,7 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kthread.h>
+#include <linux/firmware.h>
#include "osdep_service.h"
#include "drv_types.h"
#include "xmit_osdep.h"
@@ -264,12 +265,12 @@ static void start_drv_timers(struct _adapter *padapter)
void r8712_stop_drv_timers(struct _adapter *padapter)
{
_cancel_timer_ex(&padapter->mlmepriv.assoc_timer);
- _cancel_timer_ex(&padapter->mlmepriv.sitesurveyctrl.
- sitesurvey_ctrl_timer);
_cancel_timer_ex(&padapter->securitypriv.tkip_timer);
_cancel_timer_ex(&padapter->mlmepriv.scan_to_timer);
_cancel_timer_ex(&padapter->mlmepriv.dhcp_timer);
_cancel_timer_ex(&padapter->mlmepriv.wdg_timer);
+ _cancel_timer_ex(&padapter->mlmepriv.sitesurveyctrl.
+ sitesurvey_ctrl_timer);
}
static u8 init_default_value(struct _adapter *padapter)
@@ -347,7 +348,8 @@ u8 r8712_free_drv_sw(struct _adapter *padapter)
r8712_free_mlme_priv(&padapter->mlmepriv);
r8712_free_io_queue(padapter);
_free_xmit_priv(&padapter->xmitpriv);
- _r8712_free_sta_priv(&padapter->stapriv);
+ if (padapter->fw_found)
+ _r8712_free_sta_priv(&padapter->stapriv);
_r8712_free_recv_priv(&padapter->recvpriv);
mp871xdeinit(padapter);
if (pnetdev)
@@ -388,6 +390,7 @@ static int netdev_open(struct net_device *pnetdev)
{
struct _adapter *padapter = (struct _adapter *)netdev_priv(pnetdev);
+ mutex_lock(&padapter->mutex_start);
if (padapter->bup == false) {
padapter->bDriverStopped = false;
padapter->bSurpriseRemoved = false;
@@ -435,11 +438,13 @@ static int netdev_open(struct net_device *pnetdev)
/* start driver mlme relation timer */
start_drv_timers(padapter);
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_NO_LINK);
+ mutex_unlock(&padapter->mutex_start);
return 0;
netdev_open_error:
padapter->bup = false;
netif_carrier_off(pnetdev);
netif_stop_queue(pnetdev);
+ mutex_unlock(&padapter->mutex_start);
return -1;
}
@@ -473,6 +478,9 @@ static int netdev_close(struct net_device *pnetdev)
r8712_free_network_queue(padapter);
/* The interface is no longer Up: */
padapter->bup = false;
+ release_firmware(padapter->fw);
+ /* never exit with a firmware callback pending */
+ wait_for_completion(&padapter->rtl8712_fw_ready);
return 0;
}