Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220271
b: refs/heads/master
c: d809dcb
h: refs/heads/master
i:
  220269: d885eef
  220267: 5979064
  220263: 217ac86
  220255: 450cc90
v: v3
  • Loading branch information
Jason Cooper authored and Greg Kroah-Hartman committed Oct 10, 2010
1 parent 1afa5ae commit ba8d888
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ecd7559d8d0d8daf329016b4db0686376fb5dada
refs/heads/master: d809dcb9df1766cd4f45dc17cced4857dace4dc2
44 changes: 20 additions & 24 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ typedef struct dhd_info {
struct semaphore dpc_sem;

/* Thread to issue ioctl for multicast */
long sysioc_pid;
struct task_struct *sysioc_tsk;
struct semaphore sysioc_sem;
struct completion sysioc_exited;
bool set_multicast;
bool set_macaddress;
struct ether_addr macvalue;
Expand Down Expand Up @@ -334,13 +333,6 @@ uint dhd_radio_up = 1;
char iface_name[IFNAMSIZ];
module_param_string(iface_name, iface_name, IFNAMSIZ, 0);

#define DAEMONIZE(a) \
do { \
daemonize(a); \
allow_signal(SIGKILL); \
allow_signal(SIGTERM); \
} while (0)

#define BLOCKABLE() (!in_atomic())

/* The following are specific to the SDIO dongle */
Expand Down Expand Up @@ -948,9 +940,9 @@ static int _dhd_sysioc_thread(void *data)
bool in_ap = FALSE;
#endif

DAEMONIZE("dhd_sysioc");

while (down_interruptible(&dhd->sysioc_sem) == 0) {
if(kthread_should_stop())
break;
for (i = 0; i < DHD_MAX_IFS; i++) {
if (dhd->iflist[i]) {
#ifdef SOFTAP
Expand Down Expand Up @@ -992,7 +984,7 @@ static int _dhd_sysioc_thread(void *data)
}
}
}
complete_and_exit(&dhd->sysioc_exited, 0);
return 0;
}

static int dhd_set_mac_address(struct net_device *dev, void *addr)
Expand All @@ -1007,7 +999,7 @@ static int dhd_set_mac_address(struct net_device *dev, void *addr)
if (ifidx == DHD_BAD_IF)
return -1;

ASSERT(dhd->sysioc_pid >= 0);
ASSERT(dhd->sysioc_tsk);
memcpy(&dhd->macvalue, sa->sa_data, ETHER_ADDR_LEN);
dhd->set_macaddress = TRUE;
up(&dhd->sysioc_sem);
Expand All @@ -1024,7 +1016,7 @@ static void dhd_set_multicast_list(struct net_device *dev)
if (ifidx == DHD_BAD_IF)
return;

ASSERT(dhd->sysioc_pid >= 0);
ASSERT(dhd->sysioc_tsk);
dhd->set_multicast = TRUE;
up(&dhd->sysioc_sem);
}
Expand Down Expand Up @@ -1866,7 +1858,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
if (handle == NULL) {
ifp->state = WLC_E_IF_ADD;
ifp->idx = ifidx;
ASSERT(dhd->sysioc_pid >= 0);
ASSERT(dhd->sysioc_tsk);
up(&dhd->sysioc_sem);
} else
ifp->net = (struct net_device *)handle;
Expand All @@ -1889,7 +1881,7 @@ void dhd_del_if(dhd_info_t *dhd, int ifidx)

ifp->state = WLC_E_IF_DEL;
ifp->idx = ifidx;
ASSERT(dhd->sysioc_pid >= 0);
ASSERT(dhd->sysioc_tsk);
up(&dhd->sysioc_sem);
}

Expand Down Expand Up @@ -2030,11 +2022,15 @@ dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)

if (dhd_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
init_completion(&dhd->sysioc_exited);
dhd->sysioc_pid = kernel_thread(_dhd_sysioc_thread, dhd, 0);
} else {
dhd->sysioc_pid = -1;
}
dhd->sysioc_tsk = kthread_run(_dhd_sysioc_thread, dhd,
"_dhd_sysioc");
if (IS_ERR(dhd->sysioc_tsk)) {
printk(KERN_WARNING
"_dhd_sysioc thread failed to start\n");
dhd->sysioc_tsk = NULL;
}
} else
dhd->sysioc_tsk = NULL;

/*
* Save the dhd_info into the priv
Expand Down Expand Up @@ -2353,9 +2349,9 @@ void dhd_detach(dhd_pub_t *dhdp)
else
tasklet_kill(&dhd->tasklet);

if (dhd->sysioc_pid >= 0) {
KILL_PROC(dhd->sysioc_pid, SIGTERM);
wait_for_completion(&dhd->sysioc_exited);
if (dhd->sysioc_tsk) {
kthread_stop(dhd->sysioc_tsk);
dhd->sysioc_tsk = NULL;
}

dhd_bus_detach(dhdp);
Expand Down

0 comments on commit ba8d888

Please sign in to comment.