Commit 0f370346 authored by Franky Lin's avatar Franky Lin Committed by Greg Kroah-Hartman

staging: brcm80211: move sdio resource lock to dhd_sdio.c

In fullmac the lock is for race condition for sdio interface. Move
the code to dhd_sdio.c
Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 08278881
......@@ -810,10 +810,6 @@ extern uint brcmf_sdiod_drive_strength;
/* Override to force tx queueing all the time */
extern uint brcmf_force_tx_queueing;
/* thread priority for watchdog and dpc */
extern int brcmf_watchdog_prio;
extern int brcmf_dpc_prio;
#ifdef SDTEST
/* Echo packet generator (SDIO), pkts/s */
extern uint brcmf_pktgen;
......@@ -919,8 +915,6 @@ extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void *brcmf_os_open_image(char *filename);
extern int brcmf_os_get_image_block(char *buf, int len, void *image);
extern void brcmf_os_close_image(void *image);
extern void brcmf_os_sdlock(dhd_pub_t *pub);
extern void brcmf_os_sdunlock(dhd_pub_t *pub);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
......
......@@ -82,10 +82,6 @@ typedef struct dhd_info {
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
spinlock_t sdlock;
/* Thread based operation */
bool threads_only;
struct semaphore sdsem;
/* Thread to issue ioctl for multicast */
struct task_struct *sysioc_tsk;
......@@ -1489,9 +1485,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Initialize other structure content */
init_waitqueue_head(&dhd->ioctl_resp_wait);
/* Initialize the spinlocks */
spin_lock_init(&dhd->sdlock);
/* Link to info module */
dhd->pub.info = dhd;
......@@ -1515,13 +1508,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
}
/* Initialize thread based operation and lock */
sema_init(&dhd->sdsem, 1);
if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
dhd->threads_only = true;
else
dhd->threads_only = false;
if (brcmf_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
......@@ -1941,30 +1927,6 @@ void brcmf_os_close_image(void *image)
filp_close((struct file *)image, NULL);
}
void brcmf_os_sdlock(dhd_pub_t *pub)
{
dhd_info_t *dhd;
dhd = (dhd_info_t *) (pub->info);
if (dhd->threads_only)
down(&dhd->sdsem);
else
spin_lock_bh(&dhd->sdlock);
}
void brcmf_os_sdunlock(dhd_pub_t *pub)
{
dhd_info_t *dhd;
dhd = (dhd_info_t *) (pub->info);
if (dhd->threads_only)
up(&dhd->sdsem);
else
spin_unlock_bh(&dhd->sdlock);
}
static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment