Skip to content

Commit

Permalink
prism54: Convert wpa_sem in a mutex
Browse files Browse the repository at this point in the history
The semaphore wpa_sem is used as mutex, convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Matthias Kaehlcke authored and John W. Linville committed Feb 29, 2008
1 parent f813921 commit f948db5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/net/wireless/prism54/isl_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
if (wpa_ie_len > MAX_WPA_IE_LEN)
wpa_ie_len = MAX_WPA_IE_LEN;

down(&priv->wpa_sem);
mutex_lock(&priv->wpa_lock);

/* try to use existing entry */
list_for_each(ptr, &priv->bss_wpa_list) {
Expand Down Expand Up @@ -2165,7 +2165,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
kfree(bss);
}

up(&priv->wpa_sem);
mutex_unlock(&priv->wpa_lock);
}

static size_t
Expand All @@ -2175,7 +2175,7 @@ prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie)
struct islpci_bss_wpa_ie *bss = NULL;
size_t len = 0;

down(&priv->wpa_sem);
mutex_lock(&priv->wpa_lock);

list_for_each(ptr, &priv->bss_wpa_list) {
bss = list_entry(ptr, struct islpci_bss_wpa_ie, list);
Expand All @@ -2187,7 +2187,7 @@ prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie)
len = bss->wpa_ie_len;
memcpy(wpa_ie, bss->wpa_ie, len);
}
up(&priv->wpa_sem);
mutex_unlock(&priv->wpa_lock);

return len;
}
Expand All @@ -2196,7 +2196,7 @@ void
prism54_wpa_bss_ie_init(islpci_private *priv)
{
INIT_LIST_HEAD(&priv->bss_wpa_list);
sema_init(&priv->wpa_sem, 1);
mutex_init(&priv->wpa_lock);
}

void
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/prism54/islpci_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ typedef struct {
int wpa; /* WPA mode enabled */
struct list_head bss_wpa_list;
int num_bss_wpa;
struct semaphore wpa_sem;
struct mutex wpa_lock;
u8 wpa_ie[MAX_WPA_IE_LEN];
size_t wpa_ie_len;

Expand Down

0 comments on commit f948db5

Please sign in to comment.