aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorUrsula Braun <braunu@de.ibm.com>2006-12-04 09:40:59 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-12-04 09:40:59 -0500
commit9163bb2e556f6c7879961df94540f0879db4717b (patch)
treec0c33bf0aa243699e5d75e2284dd72109397aa01 /drivers/s390
parent8b62bc9642300471737bc3b77b2a4a2ead46dedb (diff)
[S390] non-unique constant/macro identifiers.
Add some prefixes to constands defined in drivers/s390/net/qdio.h and drivers/s390/lcs.h to make it possible to include the three header files drivers/s390/net/qeth.h, drivers/s390/net/qdio.h and drivers/net/s390/lcs.h in one C file. This is required for the patch that generates the kerntypes.o file for use by lcrash. Signed-off-by: Ursula Braun <braunu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/qdio.c8
-rw-r--r--drivers/s390/cio/qdio.h4
-rw-r--r--drivers/s390/net/lcs.c78
-rw-r--r--drivers/s390/net/lcs.h25
-rw-r--r--drivers/s390/net/qeth.h2
-rw-r--r--drivers/s390/net/qeth_main.c6
6 files changed, 58 insertions, 65 deletions
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c
index 476aa1da5cbc..8d5fa1b4d11f 100644
--- a/drivers/s390/cio/qdio.c
+++ b/drivers/s390/cio/qdio.c
@@ -481,7 +481,7 @@ qdio_stop_polling(struct qdio_q *q)
481 unsigned char state = 0; 481 unsigned char state = 0;
482 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; 482 struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr;
483 483
484 if (!atomic_swap(&q->polling,0)) 484 if (!atomic_xchg(&q->polling,0))
485 return 1; 485 return 1;
486 486
487 QDIO_DBF_TEXT4(0,trace,"stoppoll"); 487 QDIO_DBF_TEXT4(0,trace,"stoppoll");
@@ -1964,8 +1964,8 @@ qdio_irq_check_sense(struct subchannel_id schid, struct irb *irb)
1964 QDIO_DBF_HEX0(0,sense,irb,QDIO_DBF_SENSE_LEN); 1964 QDIO_DBF_HEX0(0,sense,irb,QDIO_DBF_SENSE_LEN);
1965 1965
1966 QDIO_PRINT_WARN("sense data available on qdio channel.\n"); 1966 QDIO_PRINT_WARN("sense data available on qdio channel.\n");
1967 HEXDUMP16(WARN,"irb: ",irb); 1967 QDIO_HEXDUMP16(WARN,"irb: ",irb);
1968 HEXDUMP16(WARN,"sense data: ",irb->ecw); 1968 QDIO_HEXDUMP16(WARN,"sense data: ",irb->ecw);
1969 } 1969 }
1970 1970
1971} 1971}
@@ -3425,7 +3425,7 @@ do_qdio_handle_inbound(struct qdio_q *q, unsigned int callflags,
3425 3425
3426 if ((used_elements+count==QDIO_MAX_BUFFERS_PER_Q)&& 3426 if ((used_elements+count==QDIO_MAX_BUFFERS_PER_Q)&&
3427 (callflags&QDIO_FLAG_UNDER_INTERRUPT)) 3427 (callflags&QDIO_FLAG_UNDER_INTERRUPT))
3428 atomic_swap(&q->polling,0); 3428 atomic_xchg(&q->polling,0);
3429 3429
3430 if (used_elements) 3430 if (used_elements)
3431 return; 3431 return;
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 49bb9e371c32..42927c1b7451 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -236,7 +236,7 @@ enum qdio_irq_states {
236#define QDIO_PRINT_EMERG(x...) do { } while (0) 236#define QDIO_PRINT_EMERG(x...) do { } while (0)
237#endif 237#endif
238 238
239#define HEXDUMP16(importance,header,ptr) \ 239#define QDIO_HEXDUMP16(importance,header,ptr) \
240QDIO_PRINT_##importance(header "%02x %02x %02x %02x " \ 240QDIO_PRINT_##importance(header "%02x %02x %02x %02x " \
241 "%02x %02x %02x %02x %02x %02x %02x %02x " \ 241 "%02x %02x %02x %02x %02x %02x %02x %02x " \
242 "%02x %02x %02x %02x\n",*(((char*)ptr)), \ 242 "%02x %02x %02x %02x\n",*(((char*)ptr)), \
@@ -429,8 +429,6 @@ struct qdio_perf_stats {
429}; 429};
430#endif /* QDIO_PERFORMANCE_STATS */ 430#endif /* QDIO_PERFORMANCE_STATS */
431 431
432#define atomic_swap(a,b) xchg((int*)a.counter,b)
433
434/* unlikely as the later the better */ 432/* unlikely as the later the better */
435#define SYNC_MEMORY if (unlikely(q->siga_sync)) qdio_siga_sync_q(q) 433#define SYNC_MEMORY if (unlikely(q->siga_sync)) qdio_siga_sync_q(q)
436#define SYNC_MEMORY_ALL if (unlikely(q->siga_sync)) \ 434#define SYNC_MEMORY_ALL if (unlikely(q->siga_sync)) \
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 66a8aec6efa6..08d4e47070bd 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -54,6 +54,8 @@
54#error Cannot compile lcs.c without some net devices switched on. 54#error Cannot compile lcs.c without some net devices switched on.
55#endif 55#endif
56 56
57#define PRINTK_HEADER " lcs: "
58
57/** 59/**
58 * initialization string for output 60 * initialization string for output
59 */ 61 */
@@ -120,7 +122,7 @@ lcs_alloc_channel(struct lcs_channel *channel)
120 kzalloc(LCS_IOBUFFERSIZE, GFP_DMA | GFP_KERNEL); 122 kzalloc(LCS_IOBUFFERSIZE, GFP_DMA | GFP_KERNEL);
121 if (channel->iob[cnt].data == NULL) 123 if (channel->iob[cnt].data == NULL)
122 break; 124 break;
123 channel->iob[cnt].state = BUF_STATE_EMPTY; 125 channel->iob[cnt].state = LCS_BUF_STATE_EMPTY;
124 } 126 }
125 if (cnt < LCS_NUM_BUFFS) { 127 if (cnt < LCS_NUM_BUFFS) {
126 /* Not all io buffers could be allocated. */ 128 /* Not all io buffers could be allocated. */
@@ -236,7 +238,7 @@ lcs_setup_read_ccws(struct lcs_card *card)
236 ((struct lcs_header *) 238 ((struct lcs_header *)
237 card->read.iob[cnt].data)->offset = LCS_ILLEGAL_OFFSET; 239 card->read.iob[cnt].data)->offset = LCS_ILLEGAL_OFFSET;
238 card->read.iob[cnt].callback = lcs_get_frames_cb; 240 card->read.iob[cnt].callback = lcs_get_frames_cb;
239 card->read.iob[cnt].state = BUF_STATE_READY; 241 card->read.iob[cnt].state = LCS_BUF_STATE_READY;
240 card->read.iob[cnt].count = LCS_IOBUFFERSIZE; 242 card->read.iob[cnt].count = LCS_IOBUFFERSIZE;
241 } 243 }
242 card->read.ccws[0].flags &= ~CCW_FLAG_PCI; 244 card->read.ccws[0].flags &= ~CCW_FLAG_PCI;
@@ -247,7 +249,7 @@ lcs_setup_read_ccws(struct lcs_card *card)
247 card->read.ccws[LCS_NUM_BUFFS].cda = 249 card->read.ccws[LCS_NUM_BUFFS].cda =
248 (__u32) __pa(card->read.ccws); 250 (__u32) __pa(card->read.ccws);
249 /* Setg initial state of the read channel. */ 251 /* Setg initial state of the read channel. */
250 card->read.state = CH_STATE_INIT; 252 card->read.state = LCS_CH_STATE_INIT;
251 253
252 card->read.io_idx = 0; 254 card->read.io_idx = 0;
253 card->read.buf_idx = 0; 255 card->read.buf_idx = 0;
@@ -294,7 +296,7 @@ lcs_setup_write_ccws(struct lcs_card *card)
294 card->write.ccws[LCS_NUM_BUFFS].cda = 296 card->write.ccws[LCS_NUM_BUFFS].cda =
295 (__u32) __pa(card->write.ccws); 297 (__u32) __pa(card->write.ccws);
296 /* Set initial state of the write channel. */ 298 /* Set initial state of the write channel. */
297 card->read.state = CH_STATE_INIT; 299 card->read.state = LCS_CH_STATE_INIT;
298 300
299 card->write.io_idx = 0; 301 card->write.io_idx = 0;
300 card->write.buf_idx = 0; 302 card->write.buf_idx = 0;
@@ -496,7 +498,7 @@ lcs_start_channel(struct lcs_channel *channel)
496 channel->ccws + channel->io_idx, 0, 0, 498 channel->ccws + channel->io_idx, 0, 0,
497 DOIO_DENY_PREFETCH | DOIO_ALLOW_SUSPEND); 499 DOIO_DENY_PREFETCH | DOIO_ALLOW_SUSPEND);
498 if (rc == 0) 500 if (rc == 0)
499 channel->state = CH_STATE_RUNNING; 501 channel->state = LCS_CH_STATE_RUNNING;
500 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 502 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
501 if (rc) { 503 if (rc) {
502 LCS_DBF_TEXT_(4,trace,"essh%s", channel->ccwdev->dev.bus_id); 504 LCS_DBF_TEXT_(4,trace,"essh%s", channel->ccwdev->dev.bus_id);
@@ -520,8 +522,8 @@ lcs_clear_channel(struct lcs_channel *channel)
520 LCS_DBF_TEXT_(4,trace,"ecsc%s", channel->ccwdev->dev.bus_id); 522 LCS_DBF_TEXT_(4,trace,"ecsc%s", channel->ccwdev->dev.bus_id);
521 return rc; 523 return rc;
522 } 524 }
523 wait_event(channel->wait_q, (channel->state == CH_STATE_CLEARED)); 525 wait_event(channel->wait_q, (channel->state == LCS_CH_STATE_CLEARED));
524 channel->state = CH_STATE_STOPPED; 526 channel->state = LCS_CH_STATE_STOPPED;
525 return rc; 527 return rc;
526} 528}
527 529
@@ -535,11 +537,11 @@ lcs_stop_channel(struct lcs_channel *channel)
535 unsigned long flags; 537 unsigned long flags;
536 int rc; 538 int rc;
537 539
538 if (channel->state == CH_STATE_STOPPED) 540 if (channel->state == LCS_CH_STATE_STOPPED)
539 return 0; 541 return 0;
540 LCS_DBF_TEXT(4,trace,"haltsch"); 542 LCS_DBF_TEXT(4,trace,"haltsch");
541 LCS_DBF_TEXT_(4,trace,"%s", channel->ccwdev->dev.bus_id); 543 LCS_DBF_TEXT_(4,trace,"%s", channel->ccwdev->dev.bus_id);
542 channel->state = CH_STATE_INIT; 544 channel->state = LCS_CH_STATE_INIT;
543 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 545 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
544 rc = ccw_device_halt(channel->ccwdev, (addr_t) channel); 546 rc = ccw_device_halt(channel->ccwdev, (addr_t) channel);
545 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 547 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
@@ -548,7 +550,7 @@ lcs_stop_channel(struct lcs_channel *channel)
548 return rc; 550 return rc;
549 } 551 }
550 /* Asynchronous halt initialted. Wait for its completion. */ 552 /* Asynchronous halt initialted. Wait for its completion. */
551 wait_event(channel->wait_q, (channel->state == CH_STATE_HALTED)); 553 wait_event(channel->wait_q, (channel->state == LCS_CH_STATE_HALTED));
552 lcs_clear_channel(channel); 554 lcs_clear_channel(channel);
553 return 0; 555 return 0;
554} 556}
@@ -596,8 +598,8 @@ __lcs_get_buffer(struct lcs_channel *channel)
596 LCS_DBF_TEXT(5, trace, "_getbuff"); 598 LCS_DBF_TEXT(5, trace, "_getbuff");
597 index = channel->io_idx; 599 index = channel->io_idx;
598 do { 600 do {
599 if (channel->iob[index].state == BUF_STATE_EMPTY) { 601 if (channel->iob[index].state == LCS_BUF_STATE_EMPTY) {
600 channel->iob[index].state = BUF_STATE_LOCKED; 602 channel->iob[index].state = LCS_BUF_STATE_LOCKED;
601 return channel->iob + index; 603 return channel->iob + index;
602 } 604 }
603 index = (index + 1) & (LCS_NUM_BUFFS - 1); 605 index = (index + 1) & (LCS_NUM_BUFFS - 1);
@@ -626,7 +628,7 @@ __lcs_resume_channel(struct lcs_channel *channel)
626{ 628{
627 int rc; 629 int rc;
628 630
629 if (channel->state != CH_STATE_SUSPENDED) 631 if (channel->state != LCS_CH_STATE_SUSPENDED)
630 return 0; 632 return 0;
631 if (channel->ccws[channel->io_idx].flags & CCW_FLAG_SUSPEND) 633 if (channel->ccws[channel->io_idx].flags & CCW_FLAG_SUSPEND)
632 return 0; 634 return 0;
@@ -636,7 +638,7 @@ __lcs_resume_channel(struct lcs_channel *channel)
636 LCS_DBF_TEXT_(4, trace, "ersc%s", channel->ccwdev->dev.bus_id); 638 LCS_DBF_TEXT_(4, trace, "ersc%s", channel->ccwdev->dev.bus_id);
637 PRINT_ERR("Error in lcs_resume_channel: rc=%d\n",rc); 639 PRINT_ERR("Error in lcs_resume_channel: rc=%d\n",rc);
638 } else 640 } else
639 channel->state = CH_STATE_RUNNING; 641 channel->state = LCS_CH_STATE_RUNNING;
640 return rc; 642 return rc;
641 643
642} 644}
@@ -670,10 +672,10 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
670 int index, rc; 672 int index, rc;
671 673
672 LCS_DBF_TEXT(5, trace, "rdybuff"); 674 LCS_DBF_TEXT(5, trace, "rdybuff");
673 BUG_ON(buffer->state != BUF_STATE_LOCKED && 675 BUG_ON(buffer->state != LCS_BUF_STATE_LOCKED &&
674 buffer->state != BUF_STATE_PROCESSED); 676 buffer->state != LCS_BUF_STATE_PROCESSED);
675 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 677 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
676 buffer->state = BUF_STATE_READY; 678 buffer->state = LCS_BUF_STATE_READY;
677 index = buffer - channel->iob; 679 index = buffer - channel->iob;
678 /* Set length. */ 680 /* Set length. */
679 channel->ccws[index].count = buffer->count; 681 channel->ccws[index].count = buffer->count;
@@ -695,8 +697,8 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
695 int index, prev, next; 697 int index, prev, next;
696 698
697 LCS_DBF_TEXT(5, trace, "prcsbuff"); 699 LCS_DBF_TEXT(5, trace, "prcsbuff");
698 BUG_ON(buffer->state != BUF_STATE_READY); 700 BUG_ON(buffer->state != LCS_BUF_STATE_READY);
699 buffer->state = BUF_STATE_PROCESSED; 701 buffer->state = LCS_BUF_STATE_PROCESSED;
700 index = buffer - channel->iob; 702 index = buffer - channel->iob;
701 prev = (index - 1) & (LCS_NUM_BUFFS - 1); 703 prev = (index - 1) & (LCS_NUM_BUFFS - 1);
702 next = (index + 1) & (LCS_NUM_BUFFS - 1); 704 next = (index + 1) & (LCS_NUM_BUFFS - 1);
@@ -704,7 +706,7 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
704 channel->ccws[index].flags |= CCW_FLAG_SUSPEND; 706 channel->ccws[index].flags |= CCW_FLAG_SUSPEND;
705 channel->ccws[index].flags &= ~CCW_FLAG_PCI; 707 channel->ccws[index].flags &= ~CCW_FLAG_PCI;
706 /* Check the suspend bit of the previous buffer. */ 708 /* Check the suspend bit of the previous buffer. */
707 if (channel->iob[prev].state == BUF_STATE_READY) { 709 if (channel->iob[prev].state == LCS_BUF_STATE_READY) {
708 /* 710 /*
709 * Previous buffer is in state ready. It might have 711 * Previous buffer is in state ready. It might have
710 * happened in lcs_ready_buffer that the suspend bit 712 * happened in lcs_ready_buffer that the suspend bit
@@ -727,10 +729,10 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer)
727 unsigned long flags; 729 unsigned long flags;
728 730
729 LCS_DBF_TEXT(5, trace, "relbuff"); 731 LCS_DBF_TEXT(5, trace, "relbuff");
730 BUG_ON(buffer->state != BUF_STATE_LOCKED && 732 BUG_ON(buffer->state != LCS_BUF_STATE_LOCKED &&
731 buffer->state != BUF_STATE_PROCESSED); 733 buffer->state != LCS_BUF_STATE_PROCESSED);
732 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 734 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
733 buffer->state = BUF_STATE_EMPTY; 735 buffer->state = LCS_BUF_STATE_EMPTY;
734 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 736 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
735} 737}
736 738
@@ -1264,7 +1266,7 @@ lcs_register_mc_addresses(void *data)
1264 netif_carrier_off(card->dev); 1266 netif_carrier_off(card->dev);
1265 netif_tx_disable(card->dev); 1267 netif_tx_disable(card->dev);
1266 wait_event(card->write.wait_q, 1268 wait_event(card->write.wait_q,
1267 (card->write.state != CH_STATE_RUNNING)); 1269 (card->write.state != LCS_CH_STATE_RUNNING));
1268 lcs_fix_multicast_list(card); 1270 lcs_fix_multicast_list(card);
1269 if (card->state == DEV_STATE_UP) { 1271 if (card->state == DEV_STATE_UP) {
1270 netif_carrier_on(card->dev); 1272 netif_carrier_on(card->dev);
@@ -1404,7 +1406,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1404 } 1406 }
1405 } 1407 }
1406 /* How far in the ccw chain have we processed? */ 1408 /* How far in the ccw chain have we processed? */
1407 if ((channel->state != CH_STATE_INIT) && 1409 if ((channel->state != LCS_CH_STATE_INIT) &&
1408 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { 1410 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
1409 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) 1411 index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa)
1410 - channel->ccws; 1412 - channel->ccws;
@@ -1424,20 +1426,20 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1424 (irb->scsw.dstat & DEV_STAT_CHN_END) || 1426 (irb->scsw.dstat & DEV_STAT_CHN_END) ||
1425 (irb->scsw.dstat & DEV_STAT_UNIT_CHECK)) 1427 (irb->scsw.dstat & DEV_STAT_UNIT_CHECK))
1426 /* Mark channel as stopped. */ 1428 /* Mark channel as stopped. */
1427 channel->state = CH_STATE_STOPPED; 1429 channel->state = LCS_CH_STATE_STOPPED;
1428 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) 1430 else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED)
1429 /* CCW execution stopped on a suspend bit. */ 1431 /* CCW execution stopped on a suspend bit. */
1430 channel->state = CH_STATE_SUSPENDED; 1432 channel->state = LCS_CH_STATE_SUSPENDED;
1431 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { 1433 if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) {
1432 if (irb->scsw.cc != 0) { 1434 if (irb->scsw.cc != 0) {
1433 ccw_device_halt(channel->ccwdev, (addr_t) channel); 1435 ccw_device_halt(channel->ccwdev, (addr_t) channel);
1434 return; 1436 return;
1435 } 1437 }
1436 /* The channel has been stopped by halt_IO. */ 1438 /* The channel has been stopped by halt_IO. */
1437 channel->state = CH_STATE_HALTED; 1439 channel->state = LCS_CH_STATE_HALTED;
1438 } 1440 }
1439 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { 1441 if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) {
1440 channel->state = CH_STATE_CLEARED; 1442 channel->state = LCS_CH_STATE_CLEARED;
1441 } 1443 }
1442 /* Do the rest in the tasklet. */ 1444 /* Do the rest in the tasklet. */
1443 tasklet_schedule(&channel->irq_tasklet); 1445 tasklet_schedule(&channel->irq_tasklet);
@@ -1461,7 +1463,7 @@ lcs_tasklet(unsigned long data)
1461 /* Check for processed buffers. */ 1463 /* Check for processed buffers. */
1462 iob = channel->iob; 1464 iob = channel->iob;
1463 buf_idx = channel->buf_idx; 1465 buf_idx = channel->buf_idx;
1464 while (iob[buf_idx].state == BUF_STATE_PROCESSED) { 1466 while (iob[buf_idx].state == LCS_BUF_STATE_PROCESSED) {
1465 /* Do the callback thing. */ 1467 /* Do the callback thing. */
1466 if (iob[buf_idx].callback != NULL) 1468 if (iob[buf_idx].callback != NULL)
1467 iob[buf_idx].callback(channel, iob + buf_idx); 1469 iob[buf_idx].callback(channel, iob + buf_idx);
@@ -1469,12 +1471,12 @@ lcs_tasklet(unsigned long data)
1469 } 1471 }
1470 channel->buf_idx = buf_idx; 1472 channel->buf_idx = buf_idx;
1471 1473
1472 if (channel->state == CH_STATE_STOPPED) 1474 if (channel->state == LCS_CH_STATE_STOPPED)
1473 // FIXME: what if rc != 0 ?? 1475 // FIXME: what if rc != 0 ??
1474 rc = lcs_start_channel(channel); 1476 rc = lcs_start_channel(channel);
1475 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 1477 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
1476 if (channel->state == CH_STATE_SUSPENDED && 1478 if (channel->state == LCS_CH_STATE_SUSPENDED &&
1477 channel->iob[channel->io_idx].state == BUF_STATE_READY) { 1479 channel->iob[channel->io_idx].state == LCS_BUF_STATE_READY) {
1478 // FIXME: what if rc != 0 ?? 1480 // FIXME: what if rc != 0 ??
1479 rc = __lcs_resume_channel(channel); 1481 rc = __lcs_resume_channel(channel);
1480 } 1482 }
@@ -1689,8 +1691,8 @@ lcs_detect(struct lcs_card *card)
1689 card->state = DEV_STATE_UP; 1691 card->state = DEV_STATE_UP;
1690 } else { 1692 } else {
1691 card->state = DEV_STATE_DOWN; 1693 card->state = DEV_STATE_DOWN;
1692 card->write.state = CH_STATE_INIT; 1694 card->write.state = LCS_CH_STATE_INIT;
1693 card->read.state = CH_STATE_INIT; 1695 card->read.state = LCS_CH_STATE_INIT;
1694 } 1696 }
1695 return rc; 1697 return rc;
1696} 1698}
@@ -1705,8 +1707,8 @@ lcs_stopcard(struct lcs_card *card)
1705 1707
1706 LCS_DBF_TEXT(3, setup, "stopcard"); 1708 LCS_DBF_TEXT(3, setup, "stopcard");
1707 1709
1708 if (card->read.state != CH_STATE_STOPPED && 1710 if (card->read.state != LCS_CH_STATE_STOPPED &&
1709 card->write.state != CH_STATE_STOPPED && 1711 card->write.state != LCS_CH_STATE_STOPPED &&
1710 card->state == DEV_STATE_UP) { 1712 card->state == DEV_STATE_UP) {
1711 lcs_clear_multicast_list(card); 1713 lcs_clear_multicast_list(card);
1712 rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP); 1714 rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP);
@@ -1871,7 +1873,7 @@ lcs_stop_device(struct net_device *dev)
1871 netif_tx_disable(dev); 1873 netif_tx_disable(dev);
1872 dev->flags &= ~IFF_UP; 1874 dev->flags &= ~IFF_UP;
1873 wait_event(card->write.wait_q, 1875 wait_event(card->write.wait_q,
1874 (card->write.state != CH_STATE_RUNNING)); 1876 (card->write.state != LCS_CH_STATE_RUNNING));
1875 rc = lcs_stopcard(card); 1877 rc = lcs_stopcard(card);
1876 if (rc) 1878 if (rc)
1877 PRINT_ERR("Try it again!\n "); 1879 PRINT_ERR("Try it again!\n ");
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index b5247dc08b57..0e1e4a0a88f0 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -23,11 +23,6 @@ do { \
23} while (0) 23} while (0)
24 24
25/** 25/**
26 * some more definitions for debug or output stuff
27 */
28#define PRINTK_HEADER " lcs: "
29
30/**
31 * sysfs related stuff 26 * sysfs related stuff
32 */ 27 */
33#define CARD_FROM_DEV(cdev) \ 28#define CARD_FROM_DEV(cdev) \
@@ -127,22 +122,22 @@ do { \
127 * LCS Buffer states 122 * LCS Buffer states
128 */ 123 */
129enum lcs_buffer_states { 124enum lcs_buffer_states {
130 BUF_STATE_EMPTY, /* buffer is empty */ 125 LCS_BUF_STATE_EMPTY, /* buffer is empty */
131 BUF_STATE_LOCKED, /* buffer is locked, don't touch */ 126 LCS_BUF_STATE_LOCKED, /* buffer is locked, don't touch */
132 BUF_STATE_READY, /* buffer is ready for read/write */ 127 LCS_BUF_STATE_READY, /* buffer is ready for read/write */
133 BUF_STATE_PROCESSED, 128 LCS_BUF_STATE_PROCESSED,
134}; 129};
135 130
136/** 131/**
137 * LCS Channel State Machine declarations 132 * LCS Channel State Machine declarations
138 */ 133 */
139enum lcs_channel_states { 134enum lcs_channel_states {
140 CH_STATE_INIT, 135 LCS_CH_STATE_INIT,
141 CH_STATE_HALTED, 136 LCS_CH_STATE_HALTED,
142 CH_STATE_STOPPED, 137 LCS_CH_STATE_STOPPED,
143 CH_STATE_RUNNING, 138 LCS_CH_STATE_RUNNING,
144 CH_STATE_SUSPENDED, 139 LCS_CH_STATE_SUSPENDED,
145 CH_STATE_CLEARED, 140 LCS_CH_STATE_CLEARED,
146}; 141};
147 142
148/** 143/**
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 821383d8cbe7..53c358c7d368 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -151,8 +151,6 @@ qeth_hex_dump(unsigned char *buf, size_t len)
151#define SENSE_RESETTING_EVENT_BYTE 1 151#define SENSE_RESETTING_EVENT_BYTE 1
152#define SENSE_RESETTING_EVENT_FLAG 0x80 152#define SENSE_RESETTING_EVENT_FLAG 0x80
153 153
154#define atomic_swap(a,b) xchg((int *)a.counter, b)
155
156/* 154/*
157 * Common IO related definitions 155 * Common IO related definitions
158 */ 156 */
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 8364d5475ac7..7fdc5272c446 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -2982,7 +2982,7 @@ qeth_check_outbound_queue(struct qeth_qdio_out_q *queue)
2982 */ 2982 */
2983 if ((atomic_read(&queue->used_buffers) <= QETH_LOW_WATERMARK_PACK) || 2983 if ((atomic_read(&queue->used_buffers) <= QETH_LOW_WATERMARK_PACK) ||
2984 !atomic_read(&queue->set_pci_flags_count)){ 2984 !atomic_read(&queue->set_pci_flags_count)){
2985 if (atomic_swap(&queue->state, QETH_OUT_Q_LOCKED_FLUSH) == 2985 if (atomic_xchg(&queue->state, QETH_OUT_Q_LOCKED_FLUSH) ==
2986 QETH_OUT_Q_UNLOCKED) { 2986 QETH_OUT_Q_UNLOCKED) {
2987 /* 2987 /*
2988 * If we get in here, there was no action in 2988 * If we get in here, there was no action in
@@ -3245,7 +3245,7 @@ qeth_free_qdio_buffers(struct qeth_card *card)
3245 int i, j; 3245 int i, j;
3246 3246
3247 QETH_DBF_TEXT(trace, 2, "freeqdbf"); 3247 QETH_DBF_TEXT(trace, 2, "freeqdbf");
3248 if (atomic_swap(&card->qdio.state, QETH_QDIO_UNINITIALIZED) == 3248 if (atomic_xchg(&card->qdio.state, QETH_QDIO_UNINITIALIZED) ==
3249 QETH_QDIO_UNINITIALIZED) 3249 QETH_QDIO_UNINITIALIZED)
3250 return; 3250 return;
3251 kfree(card->qdio.in_q); 3251 kfree(card->qdio.in_q);
@@ -4366,7 +4366,7 @@ out:
4366 if (flush_count) 4366 if (flush_count)
4367 qeth_flush_buffers(queue, 0, start_index, flush_count); 4367 qeth_flush_buffers(queue, 0, start_index, flush_count);
4368 else if (!atomic_read(&queue->set_pci_flags_count)) 4368 else if (!atomic_read(&queue->set_pci_flags_count))
4369 atomic_swap(&queue->state, QETH_OUT_Q_LOCKED_FLUSH); 4369 atomic_xchg(&queue->state, QETH_OUT_Q_LOCKED_FLUSH);
4370 /* 4370 /*
4371 * queue->state will go from LOCKED -> UNLOCKED or from 4371 * queue->state will go from LOCKED -> UNLOCKED or from
4372 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us 4372 * LOCKED_FLUSH -> LOCKED if output_handler wanted to 'notify' us