aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/prism54/isl_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/prism54/isl_ioctl.c')
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index 1b595a6525f4..2d91a56d6a39 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -165,7 +165,7 @@ prism54_update_stats(struct work_struct *work)
165 struct obj_bss bss, *bss2; 165 struct obj_bss bss, *bss2;
166 union oid_res_t r; 166 union oid_res_t r;
167 167
168 down(&priv->stats_sem); 168 mutex_lock(&priv->stats_lock);
169 169
170/* Noise floor. 170/* Noise floor.
171 * I'm not sure if the unit is dBm. 171 * I'm not sure if the unit is dBm.
@@ -207,7 +207,7 @@ prism54_update_stats(struct work_struct *work)
207 mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r); 207 mgt_get_request(priv, DOT11_OID_MPDUTXFAILED, 0, NULL, &r);
208 priv->local_iwstatistics.discard.retries = r.u; 208 priv->local_iwstatistics.discard.retries = r.u;
209 209
210 up(&priv->stats_sem); 210 mutex_unlock(&priv->stats_lock);
211 211
212 return; 212 return;
213} 213}
@@ -218,12 +218,12 @@ prism54_get_wireless_stats(struct net_device *ndev)
218 islpci_private *priv = netdev_priv(ndev); 218 islpci_private *priv = netdev_priv(ndev);
219 219
220 /* If the stats are being updated return old data */ 220 /* If the stats are being updated return old data */
221 if (down_trylock(&priv->stats_sem) == 0) { 221 if (mutex_trylock(&priv->stats_lock) == 0) {
222 memcpy(&priv->iwstatistics, &priv->local_iwstatistics, 222 memcpy(&priv->iwstatistics, &priv->local_iwstatistics,
223 sizeof (struct iw_statistics)); 223 sizeof (struct iw_statistics));
224 /* They won't be marked updated for the next time */ 224 /* They won't be marked updated for the next time */
225 priv->local_iwstatistics.qual.updated = 0; 225 priv->local_iwstatistics.qual.updated = 0;
226 up(&priv->stats_sem); 226 mutex_unlock(&priv->stats_lock);
227 } else 227 } else
228 priv->iwstatistics.qual.updated = 0; 228 priv->iwstatistics.qual.updated = 0;
229 229
@@ -1780,7 +1780,7 @@ prism54_set_raw(struct net_device *ndev, struct iw_request_info *info,
1780void 1780void
1781prism54_acl_init(struct islpci_acl *acl) 1781prism54_acl_init(struct islpci_acl *acl)
1782{ 1782{
1783 sema_init(&acl->sem, 1); 1783 mutex_init(&acl->lock);
1784 INIT_LIST_HEAD(&acl->mac_list); 1784 INIT_LIST_HEAD(&acl->mac_list);
1785 acl->size = 0; 1785 acl->size = 0;
1786 acl->policy = MAC_POLICY_OPEN; 1786 acl->policy = MAC_POLICY_OPEN;
@@ -1792,10 +1792,10 @@ prism54_clear_mac(struct islpci_acl *acl)
1792 struct list_head *ptr, *next; 1792 struct list_head *ptr, *next;
1793 struct mac_entry *entry; 1793 struct mac_entry *entry;
1794 1794
1795 down(&acl->sem); 1795 mutex_lock(&acl->lock);
1796 1796
1797 if (acl->size == 0) { 1797 if (acl->size == 0) {
1798 up(&acl->sem); 1798 mutex_unlock(&acl->lock);
1799 return; 1799 return;
1800 } 1800 }
1801 1801
@@ -1806,7 +1806,7 @@ prism54_clear_mac(struct islpci_acl *acl)
1806 kfree(entry); 1806 kfree(entry);
1807 } 1807 }
1808 acl->size = 0; 1808 acl->size = 0;
1809 up(&acl->sem); 1809 mutex_unlock(&acl->lock);
1810} 1810}
1811 1811
1812void 1812void
@@ -1833,13 +1833,13 @@ prism54_add_mac(struct net_device *ndev, struct iw_request_info *info,
1833 1833
1834 memcpy(entry->addr, addr->sa_data, ETH_ALEN); 1834 memcpy(entry->addr, addr->sa_data, ETH_ALEN);
1835 1835
1836 if (down_interruptible(&acl->sem)) { 1836 if (mutex_lock_interruptible(&acl->lock)) {
1837 kfree(entry); 1837 kfree(entry);
1838 return -ERESTARTSYS; 1838 return -ERESTARTSYS;
1839 } 1839 }
1840 list_add_tail(&entry->_list, &acl->mac_list); 1840 list_add_tail(&entry->_list, &acl->mac_list);
1841 acl->size++; 1841 acl->size++;
1842 up(&acl->sem); 1842 mutex_unlock(&acl->lock);
1843 1843
1844 return 0; 1844 return 0;
1845} 1845}
@@ -1856,18 +1856,18 @@ prism54_del_mac(struct net_device *ndev, struct iw_request_info *info,
1856 if (addr->sa_family != ARPHRD_ETHER) 1856 if (addr->sa_family != ARPHRD_ETHER)
1857 return -EOPNOTSUPP; 1857 return -EOPNOTSUPP;
1858 1858
1859 if (down_interruptible(&acl->sem)) 1859 if (mutex_lock_interruptible(&acl->lock))
1860 return -ERESTARTSYS; 1860 return -ERESTARTSYS;
1861 list_for_each_entry(entry, &acl->mac_list, _list) { 1861 list_for_each_entry(entry, &acl->mac_list, _list) {
1862 if (memcmp(entry->addr, addr->sa_data, ETH_ALEN) == 0) { 1862 if (memcmp(entry->addr, addr->sa_data, ETH_ALEN) == 0) {
1863 list_del(&entry->_list); 1863 list_del(&entry->_list);
1864 acl->size--; 1864 acl->size--;
1865 kfree(entry); 1865 kfree(entry);
1866 up(&acl->sem); 1866 mutex_unlock(&acl->lock);
1867 return 0; 1867 return 0;
1868 } 1868 }
1869 } 1869 }
1870 up(&acl->sem); 1870 mutex_unlock(&acl->lock);
1871 return -EINVAL; 1871 return -EINVAL;
1872} 1872}
1873 1873
@@ -1882,7 +1882,7 @@ prism54_get_mac(struct net_device *ndev, struct iw_request_info *info,
1882 1882
1883 dwrq->length = 0; 1883 dwrq->length = 0;
1884 1884
1885 if (down_interruptible(&acl->sem)) 1885 if (mutex_lock_interruptible(&acl->lock))
1886 return -ERESTARTSYS; 1886 return -ERESTARTSYS;
1887 1887
1888 list_for_each_entry(entry, &acl->mac_list, _list) { 1888 list_for_each_entry(entry, &acl->mac_list, _list) {
@@ -1891,7 +1891,7 @@ prism54_get_mac(struct net_device *ndev, struct iw_request_info *info,
1891 dwrq->length++; 1891 dwrq->length++;
1892 dst++; 1892 dst++;
1893 } 1893 }
1894 up(&acl->sem); 1894 mutex_unlock(&acl->lock);
1895 return 0; 1895 return 0;
1896} 1896}
1897 1897
@@ -1955,11 +1955,11 @@ prism54_mac_accept(struct islpci_acl *acl, char *mac)
1955 struct mac_entry *entry; 1955 struct mac_entry *entry;
1956 int res = 0; 1956 int res = 0;
1957 1957
1958 if (down_interruptible(&acl->sem)) 1958 if (mutex_lock_interruptible(&acl->lock))
1959 return -ERESTARTSYS; 1959 return -ERESTARTSYS;
1960 1960
1961 if (acl->policy == MAC_POLICY_OPEN) { 1961 if (acl->policy == MAC_POLICY_OPEN) {
1962 up(&acl->sem); 1962 mutex_unlock(&acl->lock);
1963 return 1; 1963 return 1;
1964 } 1964 }
1965 1965
@@ -1970,7 +1970,7 @@ prism54_mac_accept(struct islpci_acl *acl, char *mac)
1970 } 1970 }
1971 } 1971 }
1972 res = (acl->policy == MAC_POLICY_ACCEPT) ? !res : res; 1972 res = (acl->policy == MAC_POLICY_ACCEPT) ? !res : res;
1973 up(&acl->sem); 1973 mutex_unlock(&acl->lock);
1974 1974
1975 return res; 1975 return res;
1976} 1976}
@@ -2114,7 +2114,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2114 if (wpa_ie_len > MAX_WPA_IE_LEN) 2114 if (wpa_ie_len > MAX_WPA_IE_LEN)
2115 wpa_ie_len = MAX_WPA_IE_LEN; 2115 wpa_ie_len = MAX_WPA_IE_LEN;
2116 2116
2117 down(&priv->wpa_sem); 2117 mutex_lock(&priv->wpa_lock);
2118 2118
2119 /* try to use existing entry */ 2119 /* try to use existing entry */
2120 list_for_each(ptr, &priv->bss_wpa_list) { 2120 list_for_each(ptr, &priv->bss_wpa_list) {
@@ -2165,7 +2165,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2165 kfree(bss); 2165 kfree(bss);
2166 } 2166 }
2167 2167
2168 up(&priv->wpa_sem); 2168 mutex_unlock(&priv->wpa_lock);
2169} 2169}
2170 2170
2171static size_t 2171static size_t
@@ -2175,7 +2175,7 @@ prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie)
2175 struct islpci_bss_wpa_ie *bss = NULL; 2175 struct islpci_bss_wpa_ie *bss = NULL;
2176 size_t len = 0; 2176 size_t len = 0;
2177 2177
2178 down(&priv->wpa_sem); 2178 mutex_lock(&priv->wpa_lock);
2179 2179
2180 list_for_each(ptr, &priv->bss_wpa_list) { 2180 list_for_each(ptr, &priv->bss_wpa_list) {
2181 bss = list_entry(ptr, struct islpci_bss_wpa_ie, list); 2181 bss = list_entry(ptr, struct islpci_bss_wpa_ie, list);
@@ -2187,7 +2187,7 @@ prism54_wpa_bss_ie_get(islpci_private *priv, u8 *bssid, u8 *wpa_ie)
2187 len = bss->wpa_ie_len; 2187 len = bss->wpa_ie_len;
2188 memcpy(wpa_ie, bss->wpa_ie, len); 2188 memcpy(wpa_ie, bss->wpa_ie, len);
2189 } 2189 }
2190 up(&priv->wpa_sem); 2190 mutex_unlock(&priv->wpa_lock);
2191 2191
2192 return len; 2192 return len;
2193} 2193}
@@ -2196,7 +2196,7 @@ void
2196prism54_wpa_bss_ie_init(islpci_private *priv) 2196prism54_wpa_bss_ie_init(islpci_private *priv)
2197{ 2197{
2198 INIT_LIST_HEAD(&priv->bss_wpa_list); 2198 INIT_LIST_HEAD(&priv->bss_wpa_list);
2199 sema_init(&priv->wpa_sem, 1); 2199 mutex_init(&priv->wpa_lock);
2200} 2200}
2201 2201
2202void 2202void