aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c15
4 files changed, 22 insertions, 33 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 9016c00f2946..80f4988adf80 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1317,27 +1317,25 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev,
1317static void rt2400pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, 1317static void rt2400pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
1318 struct rt2x00_field32 irq_field) 1318 struct rt2x00_field32 irq_field)
1319{ 1319{
1320 unsigned long flags;
1321 u32 reg; 1320 u32 reg;
1322 1321
1323 /* 1322 /*
1324 * Enable a single interrupt. The interrupt mask register 1323 * Enable a single interrupt. The interrupt mask register
1325 * access needs locking. 1324 * access needs locking.
1326 */ 1325 */
1327 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1326 spin_lock_irq(&rt2x00dev->irqmask_lock);
1328 1327
1329 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1328 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1330 rt2x00_set_field32(&reg, irq_field, 0); 1329 rt2x00_set_field32(&reg, irq_field, 0);
1331 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1330 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1332 1331
1333 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1332 spin_unlock_irq(&rt2x00dev->irqmask_lock);
1334} 1333}
1335 1334
1336static void rt2400pci_txstatus_tasklet(unsigned long data) 1335static void rt2400pci_txstatus_tasklet(unsigned long data)
1337{ 1336{
1338 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 1337 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
1339 u32 reg; 1338 u32 reg;
1340 unsigned long flags;
1341 1339
1342 /* 1340 /*
1343 * Handle all tx queues. 1341 * Handle all tx queues.
@@ -1349,7 +1347,7 @@ static void rt2400pci_txstatus_tasklet(unsigned long data)
1349 /* 1347 /*
1350 * Enable all TXDONE interrupts again. 1348 * Enable all TXDONE interrupts again.
1351 */ 1349 */
1352 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1350 spin_lock_irq(&rt2x00dev->irqmask_lock);
1353 1351
1354 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1352 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1355 rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0); 1353 rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0);
@@ -1357,7 +1355,7 @@ static void rt2400pci_txstatus_tasklet(unsigned long data)
1357 rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0); 1355 rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0);
1358 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1356 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1359 1357
1360 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1358 spin_unlock_irq(&rt2x00dev->irqmask_lock);
1361} 1359}
1362 1360
1363static void rt2400pci_tbtt_tasklet(unsigned long data) 1361static void rt2400pci_tbtt_tasklet(unsigned long data)
@@ -1378,7 +1376,6 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
1378{ 1376{
1379 struct rt2x00_dev *rt2x00dev = dev_instance; 1377 struct rt2x00_dev *rt2x00dev = dev_instance;
1380 u32 reg, mask; 1378 u32 reg, mask;
1381 unsigned long flags;
1382 1379
1383 /* 1380 /*
1384 * Get the interrupt sources & saved to local variable. 1381 * Get the interrupt sources & saved to local variable.
@@ -1420,13 +1417,13 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
1420 * Disable all interrupts for which a tasklet was scheduled right now, 1417 * Disable all interrupts for which a tasklet was scheduled right now,
1421 * the tasklet will reenable the appropriate interrupts. 1418 * the tasklet will reenable the appropriate interrupts.
1422 */ 1419 */
1423 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1420 spin_lock(&rt2x00dev->irqmask_lock);
1424 1421
1425 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1422 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1426 reg |= mask; 1423 reg |= mask;
1427 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1424 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1428 1425
1429 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1426 spin_unlock(&rt2x00dev->irqmask_lock);
1430 1427
1431 1428
1432 1429
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 0fbc18cb7304..635f80466540 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1449,27 +1449,25 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev,
1449static void rt2500pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, 1449static void rt2500pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
1450 struct rt2x00_field32 irq_field) 1450 struct rt2x00_field32 irq_field)
1451{ 1451{
1452 unsigned long flags;
1453 u32 reg; 1452 u32 reg;
1454 1453
1455 /* 1454 /*
1456 * Enable a single interrupt. The interrupt mask register 1455 * Enable a single interrupt. The interrupt mask register
1457 * access needs locking. 1456 * access needs locking.
1458 */ 1457 */
1459 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1458 spin_lock_irq(&rt2x00dev->irqmask_lock);
1460 1459
1461 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1460 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1462 rt2x00_set_field32(&reg, irq_field, 0); 1461 rt2x00_set_field32(&reg, irq_field, 0);
1463 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1462 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1464 1463
1465 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1464 spin_unlock_irq(&rt2x00dev->irqmask_lock);
1466} 1465}
1467 1466
1468static void rt2500pci_txstatus_tasklet(unsigned long data) 1467static void rt2500pci_txstatus_tasklet(unsigned long data)
1469{ 1468{
1470 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; 1469 struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
1471 u32 reg; 1470 u32 reg;
1472 unsigned long flags;
1473 1471
1474 /* 1472 /*
1475 * Handle all tx queues. 1473 * Handle all tx queues.
@@ -1481,7 +1479,7 @@ static void rt2500pci_txstatus_tasklet(unsigned long data)
1481 /* 1479 /*
1482 * Enable all TXDONE interrupts again. 1480 * Enable all TXDONE interrupts again.
1483 */ 1481 */
1484 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1482 spin_lock_irq(&rt2x00dev->irqmask_lock);
1485 1483
1486 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1484 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1487 rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0); 1485 rt2x00_set_field32(&reg, CSR8_TXDONE_TXRING, 0);
@@ -1489,7 +1487,7 @@ static void rt2500pci_txstatus_tasklet(unsigned long data)
1489 rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0); 1487 rt2x00_set_field32(&reg, CSR8_TXDONE_PRIORING, 0);
1490 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1488 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1491 1489
1492 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1490 spin_unlock_irq(&rt2x00dev->irqmask_lock);
1493} 1491}
1494 1492
1495static void rt2500pci_tbtt_tasklet(unsigned long data) 1493static void rt2500pci_tbtt_tasklet(unsigned long data)
@@ -1510,7 +1508,6 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
1510{ 1508{
1511 struct rt2x00_dev *rt2x00dev = dev_instance; 1509 struct rt2x00_dev *rt2x00dev = dev_instance;
1512 u32 reg, mask; 1510 u32 reg, mask;
1513 unsigned long flags;
1514 1511
1515 /* 1512 /*
1516 * Get the interrupt sources & saved to local variable. 1513 * Get the interrupt sources & saved to local variable.
@@ -1552,13 +1549,13 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
1552 * Disable all interrupts for which a tasklet was scheduled right now, 1549 * Disable all interrupts for which a tasklet was scheduled right now,
1553 * the tasklet will reenable the appropriate interrupts. 1550 * the tasklet will reenable the appropriate interrupts.
1554 */ 1551 */
1555 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 1552 spin_lock(&rt2x00dev->irqmask_lock);
1556 1553
1557 rt2x00pci_register_read(rt2x00dev, CSR8, &reg); 1554 rt2x00pci_register_read(rt2x00dev, CSR8, &reg);
1558 reg |= mask; 1555 reg |= mask;
1559 rt2x00pci_register_write(rt2x00dev, CSR8, reg); 1556 rt2x00pci_register_write(rt2x00dev, CSR8, reg);
1560 1557
1561 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 1558 spin_unlock(&rt2x00dev->irqmask_lock);
1562 1559
1563 return IRQ_HANDLED; 1560 return IRQ_HANDLED;
1564} 1561}
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index 49ea189c9821..b58484a80b7c 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -765,18 +765,17 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)
765static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, 765static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
766 struct rt2x00_field32 irq_field) 766 struct rt2x00_field32 irq_field)
767{ 767{
768 unsigned long flags;
769 u32 reg; 768 u32 reg;
770 769
771 /* 770 /*
772 * Enable a single interrupt. The interrupt mask register 771 * Enable a single interrupt. The interrupt mask register
773 * access needs locking. 772 * access needs locking.
774 */ 773 */
775 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 774 spin_lock_irq(&rt2x00dev->irqmask_lock);
776 rt2800_register_read(rt2x00dev, INT_MASK_CSR, &reg); 775 rt2800_register_read(rt2x00dev, INT_MASK_CSR, &reg);
777 rt2x00_set_field32(&reg, irq_field, 1); 776 rt2x00_set_field32(&reg, irq_field, 1);
778 rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg); 777 rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg);
779 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 778 spin_unlock_irq(&rt2x00dev->irqmask_lock);
780} 779}
781 780
782static void rt2800pci_txstatus_tasklet(unsigned long data) 781static void rt2800pci_txstatus_tasklet(unsigned long data)
@@ -862,7 +861,6 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance)
862{ 861{
863 struct rt2x00_dev *rt2x00dev = dev_instance; 862 struct rt2x00_dev *rt2x00dev = dev_instance;
864 u32 reg, mask; 863 u32 reg, mask;
865 unsigned long flags;
866 864
867 /* Read status and ACK all interrupts */ 865 /* Read status and ACK all interrupts */
868 rt2800_register_read(rt2x00dev, INT_SOURCE_CSR, &reg); 866 rt2800_register_read(rt2x00dev, INT_SOURCE_CSR, &reg);
@@ -905,11 +903,11 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance)
905 * Disable all interrupts for which a tasklet was scheduled right now, 903 * Disable all interrupts for which a tasklet was scheduled right now,
906 * the tasklet will reenable the appropriate interrupts. 904 * the tasklet will reenable the appropriate interrupts.
907 */ 905 */
908 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 906 spin_lock(&rt2x00dev->irqmask_lock);
909 rt2800_register_read(rt2x00dev, INT_MASK_CSR, &reg); 907 rt2800_register_read(rt2x00dev, INT_MASK_CSR, &reg);
910 reg &= mask; 908 reg &= mask;
911 rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg); 909 rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg);
912 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 910 spin_unlock(&rt2x00dev->irqmask_lock);
913 911
914 return IRQ_HANDLED; 912 return IRQ_HANDLED;
915} 913}
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index a014c64f4275..77e8113b91e1 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2263,39 +2263,37 @@ static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev)
2263static void rt61pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, 2263static void rt61pci_enable_interrupt(struct rt2x00_dev *rt2x00dev,
2264 struct rt2x00_field32 irq_field) 2264 struct rt2x00_field32 irq_field)
2265{ 2265{
2266 unsigned long flags;
2267 u32 reg; 2266 u32 reg;
2268 2267
2269 /* 2268 /*
2270 * Enable a single interrupt. The interrupt mask register 2269 * Enable a single interrupt. The interrupt mask register
2271 * access needs locking. 2270 * access needs locking.
2272 */ 2271 */
2273 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 2272 spin_lock_irq(&rt2x00dev->irqmask_lock);
2274 2273
2275 rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, &reg); 2274 rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, &reg);
2276 rt2x00_set_field32(&reg, irq_field, 0); 2275 rt2x00_set_field32(&reg, irq_field, 0);
2277 rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); 2276 rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg);
2278 2277
2279 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 2278 spin_unlock_irq(&rt2x00dev->irqmask_lock);
2280} 2279}
2281 2280
2282static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev, 2281static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev,
2283 struct rt2x00_field32 irq_field) 2282 struct rt2x00_field32 irq_field)
2284{ 2283{
2285 unsigned long flags;
2286 u32 reg; 2284 u32 reg;
2287 2285
2288 /* 2286 /*
2289 * Enable a single MCU interrupt. The interrupt mask register 2287 * Enable a single MCU interrupt. The interrupt mask register
2290 * access needs locking. 2288 * access needs locking.
2291 */ 2289 */
2292 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 2290 spin_lock_irq(&rt2x00dev->irqmask_lock);
2293 2291
2294 rt2x00pci_register_read(rt2x00dev, MCU_INT_MASK_CSR, &reg); 2292 rt2x00pci_register_read(rt2x00dev, MCU_INT_MASK_CSR, &reg);
2295 rt2x00_set_field32(&reg, irq_field, 0); 2293 rt2x00_set_field32(&reg, irq_field, 0);
2296 rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); 2294 rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg);
2297 2295
2298 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 2296 spin_unlock_irq(&rt2x00dev->irqmask_lock);
2299} 2297}
2300 2298
2301static void rt61pci_txstatus_tasklet(unsigned long data) 2299static void rt61pci_txstatus_tasklet(unsigned long data)
@@ -2333,7 +2331,6 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
2333 struct rt2x00_dev *rt2x00dev = dev_instance; 2331 struct rt2x00_dev *rt2x00dev = dev_instance;
2334 u32 reg_mcu, mask_mcu; 2332 u32 reg_mcu, mask_mcu;
2335 u32 reg, mask; 2333 u32 reg, mask;
2336 unsigned long flags;
2337 2334
2338 /* 2335 /*
2339 * Get the interrupt sources & saved to local variable. 2336 * Get the interrupt sources & saved to local variable.
@@ -2378,7 +2375,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
2378 * Disable all interrupts for which a tasklet was scheduled right now, 2375 * Disable all interrupts for which a tasklet was scheduled right now,
2379 * the tasklet will reenable the appropriate interrupts. 2376 * the tasklet will reenable the appropriate interrupts.
2380 */ 2377 */
2381 spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); 2378 spin_lock(&rt2x00dev->irqmask_lock);
2382 2379
2383 rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, &reg); 2380 rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, &reg);
2384 reg |= mask; 2381 reg |= mask;
@@ -2388,7 +2385,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
2388 reg |= mask_mcu; 2385 reg |= mask_mcu;
2389 rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); 2386 rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg);
2390 2387
2391 spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); 2388 spin_unlock(&rt2x00dev->irqmask_lock);
2392 2389
2393 return IRQ_HANDLED; 2390 return IRQ_HANDLED;
2394} 2391}