diff options
Diffstat (limited to 'drivers/s390/net')
| -rw-r--r-- | drivers/s390/net/claw.c | 118 | ||||
| -rw-r--r-- | drivers/s390/net/claw.h | 4 | ||||
| -rw-r--r-- | drivers/s390/net/ctcm_fsms.c | 60 | ||||
| -rw-r--r-- | drivers/s390/net/ctcm_main.c | 80 | ||||
| -rw-r--r-- | drivers/s390/net/ctcm_main.h | 4 | ||||
| -rw-r--r-- | drivers/s390/net/ctcm_mpc.c | 64 | ||||
| -rw-r--r-- | drivers/s390/net/ctcm_sysfs.c | 20 |
7 files changed, 179 insertions, 171 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index a75ed3083a6a..8e4153d740f3 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
| @@ -386,7 +386,7 @@ claw_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 386 | struct chbk *p_ch; | 386 | struct chbk *p_ch; |
| 387 | 387 | ||
| 388 | CLAW_DBF_TEXT(4, trace, "claw_tx"); | 388 | CLAW_DBF_TEXT(4, trace, "claw_tx"); |
| 389 | p_ch=&privptr->channel[WRITE]; | 389 | p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 390 | spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); | 390 | spin_lock_irqsave(get_ccwdev_lock(p_ch->cdev), saveflags); |
| 391 | rc=claw_hw_tx( skb, dev, 1 ); | 391 | rc=claw_hw_tx( skb, dev, 1 ); |
| 392 | spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); | 392 | spin_unlock_irqrestore(get_ccwdev_lock(p_ch->cdev), saveflags); |
| @@ -407,7 +407,7 @@ static struct sk_buff * | |||
| 407 | claw_pack_skb(struct claw_privbk *privptr) | 407 | claw_pack_skb(struct claw_privbk *privptr) |
| 408 | { | 408 | { |
| 409 | struct sk_buff *new_skb,*held_skb; | 409 | struct sk_buff *new_skb,*held_skb; |
| 410 | struct chbk *p_ch = &privptr->channel[WRITE]; | 410 | struct chbk *p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 411 | struct claw_env *p_env = privptr->p_env; | 411 | struct claw_env *p_env = privptr->p_env; |
| 412 | int pkt_cnt,pk_ind,so_far; | 412 | int pkt_cnt,pk_ind,so_far; |
| 413 | 413 | ||
| @@ -515,15 +515,15 @@ claw_open(struct net_device *dev) | |||
| 515 | privptr->p_env->write_size=CLAW_FRAME_SIZE; | 515 | privptr->p_env->write_size=CLAW_FRAME_SIZE; |
| 516 | } | 516 | } |
| 517 | claw_set_busy(dev); | 517 | claw_set_busy(dev); |
| 518 | tasklet_init(&privptr->channel[READ].tasklet, claw_irq_tasklet, | 518 | tasklet_init(&privptr->channel[READ_CHANNEL].tasklet, claw_irq_tasklet, |
| 519 | (unsigned long) &privptr->channel[READ]); | 519 | (unsigned long) &privptr->channel[READ_CHANNEL]); |
| 520 | for ( i = 0; i < 2; i++) { | 520 | for ( i = 0; i < 2; i++) { |
| 521 | CLAW_DBF_TEXT_(2, trace, "opn_ch%d", i); | 521 | CLAW_DBF_TEXT_(2, trace, "opn_ch%d", i); |
| 522 | init_waitqueue_head(&privptr->channel[i].wait); | 522 | init_waitqueue_head(&privptr->channel[i].wait); |
| 523 | /* skb_queue_head_init(&p_ch->io_queue); */ | 523 | /* skb_queue_head_init(&p_ch->io_queue); */ |
| 524 | if (i == WRITE) | 524 | if (i == WRITE_CHANNEL) |
| 525 | skb_queue_head_init( | 525 | skb_queue_head_init( |
| 526 | &privptr->channel[WRITE].collect_queue); | 526 | &privptr->channel[WRITE_CHANNEL].collect_queue); |
| 527 | privptr->channel[i].flag_a = 0; | 527 | privptr->channel[i].flag_a = 0; |
| 528 | privptr->channel[i].IO_active = 0; | 528 | privptr->channel[i].IO_active = 0; |
| 529 | privptr->channel[i].flag &= ~CLAW_TIMER; | 529 | privptr->channel[i].flag &= ~CLAW_TIMER; |
| @@ -551,12 +551,12 @@ claw_open(struct net_device *dev) | |||
| 551 | if((privptr->channel[i].flag & CLAW_TIMER) == 0x00) | 551 | if((privptr->channel[i].flag & CLAW_TIMER) == 0x00) |
| 552 | del_timer(&timer); | 552 | del_timer(&timer); |
| 553 | } | 553 | } |
| 554 | if ((((privptr->channel[READ].last_dstat | | 554 | if ((((privptr->channel[READ_CHANNEL].last_dstat | |
| 555 | privptr->channel[WRITE].last_dstat) & | 555 | privptr->channel[WRITE_CHANNEL].last_dstat) & |
| 556 | ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) || | 556 | ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) || |
| 557 | (((privptr->channel[READ].flag | | 557 | (((privptr->channel[READ_CHANNEL].flag | |
| 558 | privptr->channel[WRITE].flag) & CLAW_TIMER) != 0x00)) { | 558 | privptr->channel[WRITE_CHANNEL].flag) & CLAW_TIMER) != 0x00)) { |
| 559 | dev_info(&privptr->channel[READ].cdev->dev, | 559 | dev_info(&privptr->channel[READ_CHANNEL].cdev->dev, |
| 560 | "%s: remote side is not ready\n", dev->name); | 560 | "%s: remote side is not ready\n", dev->name); |
| 561 | CLAW_DBF_TEXT(2, trace, "notrdy"); | 561 | CLAW_DBF_TEXT(2, trace, "notrdy"); |
| 562 | 562 | ||
| @@ -608,8 +608,8 @@ claw_open(struct net_device *dev) | |||
| 608 | } | 608 | } |
| 609 | } | 609 | } |
| 610 | privptr->buffs_alloc = 0; | 610 | privptr->buffs_alloc = 0; |
| 611 | privptr->channel[READ].flag= 0x00; | 611 | privptr->channel[READ_CHANNEL].flag = 0x00; |
| 612 | privptr->channel[WRITE].flag = 0x00; | 612 | privptr->channel[WRITE_CHANNEL].flag = 0x00; |
| 613 | privptr->p_buff_ccw=NULL; | 613 | privptr->p_buff_ccw=NULL; |
| 614 | privptr->p_buff_read=NULL; | 614 | privptr->p_buff_read=NULL; |
| 615 | privptr->p_buff_write=NULL; | 615 | privptr->p_buff_write=NULL; |
| @@ -652,10 +652,10 @@ claw_irq_handler(struct ccw_device *cdev, | |||
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | /* Try to extract channel from driver data. */ | 654 | /* Try to extract channel from driver data. */ |
| 655 | if (privptr->channel[READ].cdev == cdev) | 655 | if (privptr->channel[READ_CHANNEL].cdev == cdev) |
| 656 | p_ch = &privptr->channel[READ]; | 656 | p_ch = &privptr->channel[READ_CHANNEL]; |
| 657 | else if (privptr->channel[WRITE].cdev == cdev) | 657 | else if (privptr->channel[WRITE_CHANNEL].cdev == cdev) |
| 658 | p_ch = &privptr->channel[WRITE]; | 658 | p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 659 | else { | 659 | else { |
| 660 | dev_warn(&cdev->dev, "The device is not a CLAW device\n"); | 660 | dev_warn(&cdev->dev, "The device is not a CLAW device\n"); |
| 661 | CLAW_DBF_TEXT(2, trace, "badchan"); | 661 | CLAW_DBF_TEXT(2, trace, "badchan"); |
| @@ -813,7 +813,7 @@ claw_irq_handler(struct ccw_device *cdev, | |||
| 813 | claw_clearbit_busy(TB_TX, dev); | 813 | claw_clearbit_busy(TB_TX, dev); |
| 814 | claw_clear_busy(dev); | 814 | claw_clear_busy(dev); |
| 815 | } | 815 | } |
| 816 | p_ch_r = (struct chbk *)&privptr->channel[READ]; | 816 | p_ch_r = (struct chbk *)&privptr->channel[READ_CHANNEL]; |
| 817 | if (test_and_set_bit(CLAW_BH_ACTIVE, | 817 | if (test_and_set_bit(CLAW_BH_ACTIVE, |
| 818 | (void *)&p_ch_r->flag_a) == 0) | 818 | (void *)&p_ch_r->flag_a) == 0) |
| 819 | tasklet_schedule(&p_ch_r->tasklet); | 819 | tasklet_schedule(&p_ch_r->tasklet); |
| @@ -878,13 +878,13 @@ claw_release(struct net_device *dev) | |||
| 878 | for ( i = 1; i >=0 ; i--) { | 878 | for ( i = 1; i >=0 ; i--) { |
| 879 | spin_lock_irqsave( | 879 | spin_lock_irqsave( |
| 880 | get_ccwdev_lock(privptr->channel[i].cdev), saveflags); | 880 | get_ccwdev_lock(privptr->channel[i].cdev), saveflags); |
| 881 | /* del_timer(&privptr->channel[READ].timer); */ | 881 | /* del_timer(&privptr->channel[READ_CHANNEL].timer); */ |
| 882 | privptr->channel[i].claw_state = CLAW_STOP; | 882 | privptr->channel[i].claw_state = CLAW_STOP; |
| 883 | privptr->channel[i].IO_active = 0; | 883 | privptr->channel[i].IO_active = 0; |
| 884 | parm = (unsigned long) &privptr->channel[i]; | 884 | parm = (unsigned long) &privptr->channel[i]; |
| 885 | if (i == WRITE) | 885 | if (i == WRITE_CHANNEL) |
| 886 | claw_purge_skb_queue( | 886 | claw_purge_skb_queue( |
| 887 | &privptr->channel[WRITE].collect_queue); | 887 | &privptr->channel[WRITE_CHANNEL].collect_queue); |
| 888 | rc = ccw_device_halt (privptr->channel[i].cdev, parm); | 888 | rc = ccw_device_halt (privptr->channel[i].cdev, parm); |
| 889 | if (privptr->system_validate_comp==0x00) /* never opened? */ | 889 | if (privptr->system_validate_comp==0x00) /* never opened? */ |
| 890 | init_waitqueue_head(&privptr->channel[i].wait); | 890 | init_waitqueue_head(&privptr->channel[i].wait); |
| @@ -971,16 +971,16 @@ claw_release(struct net_device *dev) | |||
| 971 | privptr->mtc_skipping = 1; | 971 | privptr->mtc_skipping = 1; |
| 972 | privptr->mtc_offset=0; | 972 | privptr->mtc_offset=0; |
| 973 | 973 | ||
| 974 | if (((privptr->channel[READ].last_dstat | | 974 | if (((privptr->channel[READ_CHANNEL].last_dstat | |
| 975 | privptr->channel[WRITE].last_dstat) & | 975 | privptr->channel[WRITE_CHANNEL].last_dstat) & |
| 976 | ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) { | 976 | ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) != 0x00) { |
| 977 | dev_warn(&privptr->channel[READ].cdev->dev, | 977 | dev_warn(&privptr->channel[READ_CHANNEL].cdev->dev, |
| 978 | "Deactivating %s completed with incorrect" | 978 | "Deactivating %s completed with incorrect" |
| 979 | " subchannel status " | 979 | " subchannel status " |
| 980 | "(read %02x, write %02x)\n", | 980 | "(read %02x, write %02x)\n", |
| 981 | dev->name, | 981 | dev->name, |
| 982 | privptr->channel[READ].last_dstat, | 982 | privptr->channel[READ_CHANNEL].last_dstat, |
| 983 | privptr->channel[WRITE].last_dstat); | 983 | privptr->channel[WRITE_CHANNEL].last_dstat); |
| 984 | CLAW_DBF_TEXT(2, trace, "badclose"); | 984 | CLAW_DBF_TEXT(2, trace, "badclose"); |
| 985 | } | 985 | } |
| 986 | CLAW_DBF_TEXT(4, trace, "rlsexit"); | 986 | CLAW_DBF_TEXT(4, trace, "rlsexit"); |
| @@ -1324,7 +1324,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
| 1324 | 1324 | ||
| 1325 | CLAW_DBF_TEXT(4, trace, "hw_tx"); | 1325 | CLAW_DBF_TEXT(4, trace, "hw_tx"); |
| 1326 | privptr = (struct claw_privbk *)(dev->ml_priv); | 1326 | privptr = (struct claw_privbk *)(dev->ml_priv); |
| 1327 | p_ch=(struct chbk *)&privptr->channel[WRITE]; | 1327 | p_ch = (struct chbk *)&privptr->channel[WRITE_CHANNEL]; |
| 1328 | p_env =privptr->p_env; | 1328 | p_env =privptr->p_env; |
| 1329 | claw_free_wrt_buf(dev); /* Clean up free chain if posible */ | 1329 | claw_free_wrt_buf(dev); /* Clean up free chain if posible */ |
| 1330 | /* scan the write queue to free any completed write packets */ | 1330 | /* scan the write queue to free any completed write packets */ |
| @@ -1357,7 +1357,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
| 1357 | claw_strt_out_IO(dev ); | 1357 | claw_strt_out_IO(dev ); |
| 1358 | claw_free_wrt_buf( dev ); | 1358 | claw_free_wrt_buf( dev ); |
| 1359 | if (privptr->write_free_count==0) { | 1359 | if (privptr->write_free_count==0) { |
| 1360 | ch = &privptr->channel[WRITE]; | 1360 | ch = &privptr->channel[WRITE_CHANNEL]; |
| 1361 | atomic_inc(&skb->users); | 1361 | atomic_inc(&skb->users); |
| 1362 | skb_queue_tail(&ch->collect_queue, skb); | 1362 | skb_queue_tail(&ch->collect_queue, skb); |
| 1363 | goto Done; | 1363 | goto Done; |
| @@ -1369,7 +1369,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
| 1369 | } | 1369 | } |
| 1370 | /* tx lock */ | 1370 | /* tx lock */ |
| 1371 | if (claw_test_and_setbit_busy(TB_TX,dev)) { /* set to busy */ | 1371 | if (claw_test_and_setbit_busy(TB_TX,dev)) { /* set to busy */ |
| 1372 | ch = &privptr->channel[WRITE]; | 1372 | ch = &privptr->channel[WRITE_CHANNEL]; |
| 1373 | atomic_inc(&skb->users); | 1373 | atomic_inc(&skb->users); |
| 1374 | skb_queue_tail(&ch->collect_queue, skb); | 1374 | skb_queue_tail(&ch->collect_queue, skb); |
| 1375 | claw_strt_out_IO(dev ); | 1375 | claw_strt_out_IO(dev ); |
| @@ -1385,7 +1385,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
| 1385 | privptr->p_write_free_chain == NULL ) { | 1385 | privptr->p_write_free_chain == NULL ) { |
| 1386 | 1386 | ||
| 1387 | claw_setbit_busy(TB_NOBUFFER,dev); | 1387 | claw_setbit_busy(TB_NOBUFFER,dev); |
| 1388 | ch = &privptr->channel[WRITE]; | 1388 | ch = &privptr->channel[WRITE_CHANNEL]; |
| 1389 | atomic_inc(&skb->users); | 1389 | atomic_inc(&skb->users); |
| 1390 | skb_queue_tail(&ch->collect_queue, skb); | 1390 | skb_queue_tail(&ch->collect_queue, skb); |
| 1391 | CLAW_DBF_TEXT(2, trace, "clawbusy"); | 1391 | CLAW_DBF_TEXT(2, trace, "clawbusy"); |
| @@ -1397,7 +1397,7 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
| 1397 | while (len_of_data > 0) { | 1397 | while (len_of_data > 0) { |
| 1398 | p_this_ccw=privptr->p_write_free_chain; /* get a block */ | 1398 | p_this_ccw=privptr->p_write_free_chain; /* get a block */ |
| 1399 | if (p_this_ccw == NULL) { /* lost the race */ | 1399 | if (p_this_ccw == NULL) { /* lost the race */ |
| 1400 | ch = &privptr->channel[WRITE]; | 1400 | ch = &privptr->channel[WRITE_CHANNEL]; |
| 1401 | atomic_inc(&skb->users); | 1401 | atomic_inc(&skb->users); |
| 1402 | skb_queue_tail(&ch->collect_queue, skb); | 1402 | skb_queue_tail(&ch->collect_queue, skb); |
| 1403 | goto Done2; | 1403 | goto Done2; |
| @@ -2067,7 +2067,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw) | |||
| 2067 | *catch up to each other */ | 2067 | *catch up to each other */ |
| 2068 | privptr = dev->ml_priv; | 2068 | privptr = dev->ml_priv; |
| 2069 | p_env=privptr->p_env; | 2069 | p_env=privptr->p_env; |
| 2070 | tdev = &privptr->channel[READ].cdev->dev; | 2070 | tdev = &privptr->channel[READ_CHANNEL].cdev->dev; |
| 2071 | memcpy( &temp_host_name, p_env->host_name, 8); | 2071 | memcpy( &temp_host_name, p_env->host_name, 8); |
| 2072 | memcpy( &temp_ws_name, p_env->adapter_name , 8); | 2072 | memcpy( &temp_ws_name, p_env->adapter_name , 8); |
| 2073 | dev_info(tdev, "%s: CLAW device %.8s: " | 2073 | dev_info(tdev, "%s: CLAW device %.8s: " |
| @@ -2245,7 +2245,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw) | |||
| 2245 | dev->name, temp_ws_name, | 2245 | dev->name, temp_ws_name, |
| 2246 | p_ctlbk->linkid); | 2246 | p_ctlbk->linkid); |
| 2247 | privptr->active_link_ID = p_ctlbk->linkid; | 2247 | privptr->active_link_ID = p_ctlbk->linkid; |
| 2248 | p_ch = &privptr->channel[WRITE]; | 2248 | p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 2249 | wake_up(&p_ch->wait); /* wake up claw_open ( WRITE) */ | 2249 | wake_up(&p_ch->wait); /* wake up claw_open ( WRITE) */ |
| 2250 | break; | 2250 | break; |
| 2251 | case CONNECTION_RESPONSE: | 2251 | case CONNECTION_RESPONSE: |
| @@ -2296,7 +2296,7 @@ claw_process_control( struct net_device *dev, struct ccwbk * p_ccw) | |||
| 2296 | "%s: Confirmed Now packing\n", dev->name); | 2296 | "%s: Confirmed Now packing\n", dev->name); |
| 2297 | p_env->packing = DO_PACKED; | 2297 | p_env->packing = DO_PACKED; |
| 2298 | } | 2298 | } |
| 2299 | p_ch = &privptr->channel[WRITE]; | 2299 | p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 2300 | wake_up(&p_ch->wait); | 2300 | wake_up(&p_ch->wait); |
| 2301 | } else { | 2301 | } else { |
| 2302 | dev_warn(tdev, "Activating %s failed because of" | 2302 | dev_warn(tdev, "Activating %s failed because of" |
| @@ -2556,7 +2556,7 @@ unpack_read(struct net_device *dev ) | |||
| 2556 | p_packd=NULL; | 2556 | p_packd=NULL; |
| 2557 | privptr = dev->ml_priv; | 2557 | privptr = dev->ml_priv; |
| 2558 | 2558 | ||
| 2559 | p_dev = &privptr->channel[READ].cdev->dev; | 2559 | p_dev = &privptr->channel[READ_CHANNEL].cdev->dev; |
| 2560 | p_env = privptr->p_env; | 2560 | p_env = privptr->p_env; |
| 2561 | p_this_ccw=privptr->p_read_active_first; | 2561 | p_this_ccw=privptr->p_read_active_first; |
| 2562 | while (p_this_ccw!=NULL && p_this_ccw->header.flag!=CLAW_PENDING) { | 2562 | while (p_this_ccw!=NULL && p_this_ccw->header.flag!=CLAW_PENDING) { |
| @@ -2728,7 +2728,7 @@ claw_strt_read (struct net_device *dev, int lock ) | |||
| 2728 | struct ccwbk*p_ccwbk; | 2728 | struct ccwbk*p_ccwbk; |
| 2729 | struct chbk *p_ch; | 2729 | struct chbk *p_ch; |
| 2730 | struct clawh *p_clawh; | 2730 | struct clawh *p_clawh; |
| 2731 | p_ch=&privptr->channel[READ]; | 2731 | p_ch = &privptr->channel[READ_CHANNEL]; |
| 2732 | 2732 | ||
| 2733 | CLAW_DBF_TEXT(4, trace, "StRdNter"); | 2733 | CLAW_DBF_TEXT(4, trace, "StRdNter"); |
| 2734 | p_clawh=(struct clawh *)privptr->p_claw_signal_blk; | 2734 | p_clawh=(struct clawh *)privptr->p_claw_signal_blk; |
| @@ -2782,7 +2782,7 @@ claw_strt_out_IO( struct net_device *dev ) | |||
| 2782 | return; | 2782 | return; |
| 2783 | } | 2783 | } |
| 2784 | privptr = (struct claw_privbk *)dev->ml_priv; | 2784 | privptr = (struct claw_privbk *)dev->ml_priv; |
| 2785 | p_ch=&privptr->channel[WRITE]; | 2785 | p_ch = &privptr->channel[WRITE_CHANNEL]; |
| 2786 | 2786 | ||
| 2787 | CLAW_DBF_TEXT(4, trace, "strt_io"); | 2787 | CLAW_DBF_TEXT(4, trace, "strt_io"); |
| 2788 | p_first_ccw=privptr->p_write_active_first; | 2788 | p_first_ccw=privptr->p_write_active_first; |
| @@ -2875,7 +2875,7 @@ claw_free_netdevice(struct net_device * dev, int free_dev) | |||
| 2875 | if (dev->flags & IFF_RUNNING) | 2875 | if (dev->flags & IFF_RUNNING) |
| 2876 | claw_release(dev); | 2876 | claw_release(dev); |
| 2877 | if (privptr) { | 2877 | if (privptr) { |
| 2878 | privptr->channel[READ].ndev = NULL; /* say it's free */ | 2878 | privptr->channel[READ_CHANNEL].ndev = NULL; /* say it's free */ |
| 2879 | } | 2879 | } |
| 2880 | dev->ml_priv = NULL; | 2880 | dev->ml_priv = NULL; |
| 2881 | #ifdef MODULE | 2881 | #ifdef MODULE |
| @@ -2960,18 +2960,18 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
| 2960 | struct ccw_dev_id dev_id; | 2960 | struct ccw_dev_id dev_id; |
| 2961 | 2961 | ||
| 2962 | dev_info(&cgdev->dev, "add for %s\n", | 2962 | dev_info(&cgdev->dev, "add for %s\n", |
| 2963 | dev_name(&cgdev->cdev[READ]->dev)); | 2963 | dev_name(&cgdev->cdev[READ_CHANNEL]->dev)); |
| 2964 | CLAW_DBF_TEXT(2, setup, "new_dev"); | 2964 | CLAW_DBF_TEXT(2, setup, "new_dev"); |
| 2965 | privptr = dev_get_drvdata(&cgdev->dev); | 2965 | privptr = dev_get_drvdata(&cgdev->dev); |
| 2966 | dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); | 2966 | dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, privptr); |
| 2967 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); | 2967 | dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, privptr); |
| 2968 | if (!privptr) | 2968 | if (!privptr) |
| 2969 | return -ENODEV; | 2969 | return -ENODEV; |
| 2970 | p_env = privptr->p_env; | 2970 | p_env = privptr->p_env; |
| 2971 | ccw_device_get_id(cgdev->cdev[READ], &dev_id); | 2971 | ccw_device_get_id(cgdev->cdev[READ_CHANNEL], &dev_id); |
| 2972 | p_env->devno[READ] = dev_id.devno; | 2972 | p_env->devno[READ_CHANNEL] = dev_id.devno; |
| 2973 | ccw_device_get_id(cgdev->cdev[WRITE], &dev_id); | 2973 | ccw_device_get_id(cgdev->cdev[WRITE_CHANNEL], &dev_id); |
| 2974 | p_env->devno[WRITE] = dev_id.devno; | 2974 | p_env->devno[WRITE_CHANNEL] = dev_id.devno; |
| 2975 | ret = add_channel(cgdev->cdev[0],0,privptr); | 2975 | ret = add_channel(cgdev->cdev[0],0,privptr); |
| 2976 | if (ret == 0) | 2976 | if (ret == 0) |
| 2977 | ret = add_channel(cgdev->cdev[1],1,privptr); | 2977 | ret = add_channel(cgdev->cdev[1],1,privptr); |
| @@ -2980,14 +2980,14 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
| 2980 | " failed with error code %d\n", ret); | 2980 | " failed with error code %d\n", ret); |
| 2981 | goto out; | 2981 | goto out; |
| 2982 | } | 2982 | } |
| 2983 | ret = ccw_device_set_online(cgdev->cdev[READ]); | 2983 | ret = ccw_device_set_online(cgdev->cdev[READ_CHANNEL]); |
| 2984 | if (ret != 0) { | 2984 | if (ret != 0) { |
| 2985 | dev_warn(&cgdev->dev, | 2985 | dev_warn(&cgdev->dev, |
| 2986 | "Setting the read subchannel online" | 2986 | "Setting the read subchannel online" |
| 2987 | " failed with error code %d\n", ret); | 2987 | " failed with error code %d\n", ret); |
| 2988 | goto out; | 2988 | goto out; |
| 2989 | } | 2989 | } |
| 2990 | ret = ccw_device_set_online(cgdev->cdev[WRITE]); | 2990 | ret = ccw_device_set_online(cgdev->cdev[WRITE_CHANNEL]); |
| 2991 | if (ret != 0) { | 2991 | if (ret != 0) { |
| 2992 | dev_warn(&cgdev->dev, | 2992 | dev_warn(&cgdev->dev, |
| 2993 | "Setting the write subchannel online " | 2993 | "Setting the write subchannel online " |
| @@ -3002,8 +3002,8 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
| 3002 | } | 3002 | } |
| 3003 | dev->ml_priv = privptr; | 3003 | dev->ml_priv = privptr; |
| 3004 | dev_set_drvdata(&cgdev->dev, privptr); | 3004 | dev_set_drvdata(&cgdev->dev, privptr); |
| 3005 | dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr); | 3005 | dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, privptr); |
| 3006 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr); | 3006 | dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, privptr); |
| 3007 | /* sysfs magic */ | 3007 | /* sysfs magic */ |
| 3008 | SET_NETDEV_DEV(dev, &cgdev->dev); | 3008 | SET_NETDEV_DEV(dev, &cgdev->dev); |
| 3009 | if (register_netdev(dev) != 0) { | 3009 | if (register_netdev(dev) != 0) { |
| @@ -3021,16 +3021,16 @@ claw_new_device(struct ccwgroup_device *cgdev) | |||
| 3021 | goto out; | 3021 | goto out; |
| 3022 | } | 3022 | } |
| 3023 | } | 3023 | } |
| 3024 | privptr->channel[READ].ndev = dev; | 3024 | privptr->channel[READ_CHANNEL].ndev = dev; |
| 3025 | privptr->channel[WRITE].ndev = dev; | 3025 | privptr->channel[WRITE_CHANNEL].ndev = dev; |
| 3026 | privptr->p_env->ndev = dev; | 3026 | privptr->p_env->ndev = dev; |
| 3027 | 3027 | ||
| 3028 | dev_info(&cgdev->dev, "%s:readsize=%d writesize=%d " | 3028 | dev_info(&cgdev->dev, "%s:readsize=%d writesize=%d " |
| 3029 | "readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n", | 3029 | "readbuffer=%d writebuffer=%d read=0x%04x write=0x%04x\n", |
| 3030 | dev->name, p_env->read_size, | 3030 | dev->name, p_env->read_size, |
| 3031 | p_env->write_size, p_env->read_buffers, | 3031 | p_env->write_size, p_env->read_buffers, |
| 3032 | p_env->write_buffers, p_env->devno[READ], | 3032 | p_env->write_buffers, p_env->devno[READ_CHANNEL], |
| 3033 | p_env->devno[WRITE]); | 3033 | p_env->devno[WRITE_CHANNEL]); |
| 3034 | dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name " | 3034 | dev_info(&cgdev->dev, "%s:host_name:%.8s, adapter_name " |
| 3035 | ":%.8s api_type: %.8s\n", | 3035 | ":%.8s api_type: %.8s\n", |
| 3036 | dev->name, p_env->host_name, | 3036 | dev->name, p_env->host_name, |
| @@ -3072,10 +3072,10 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) | |||
| 3072 | priv = dev_get_drvdata(&cgdev->dev); | 3072 | priv = dev_get_drvdata(&cgdev->dev); |
| 3073 | if (!priv) | 3073 | if (!priv) |
| 3074 | return -ENODEV; | 3074 | return -ENODEV; |
| 3075 | ndev = priv->channel[READ].ndev; | 3075 | ndev = priv->channel[READ_CHANNEL].ndev; |
| 3076 | if (ndev) { | 3076 | if (ndev) { |
| 3077 | /* Close the device */ | 3077 | /* Close the device */ |
| 3078 | dev_info(&cgdev->dev, "%s: shutting down \n", | 3078 | dev_info(&cgdev->dev, "%s: shutting down\n", |
| 3079 | ndev->name); | 3079 | ndev->name); |
| 3080 | if (ndev->flags & IFF_RUNNING) | 3080 | if (ndev->flags & IFF_RUNNING) |
| 3081 | ret = claw_release(ndev); | 3081 | ret = claw_release(ndev); |
| @@ -3083,8 +3083,8 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) | |||
| 3083 | unregister_netdev(ndev); | 3083 | unregister_netdev(ndev); |
| 3084 | ndev->ml_priv = NULL; /* cgdev data, not ndev's to free */ | 3084 | ndev->ml_priv = NULL; /* cgdev data, not ndev's to free */ |
| 3085 | claw_free_netdevice(ndev, 1); | 3085 | claw_free_netdevice(ndev, 1); |
| 3086 | priv->channel[READ].ndev = NULL; | 3086 | priv->channel[READ_CHANNEL].ndev = NULL; |
| 3087 | priv->channel[WRITE].ndev = NULL; | 3087 | priv->channel[WRITE_CHANNEL].ndev = NULL; |
| 3088 | priv->p_env->ndev = NULL; | 3088 | priv->p_env->ndev = NULL; |
| 3089 | } | 3089 | } |
| 3090 | ccw_device_set_offline(cgdev->cdev[1]); | 3090 | ccw_device_set_offline(cgdev->cdev[1]); |
| @@ -3115,8 +3115,8 @@ claw_remove_device(struct ccwgroup_device *cgdev) | |||
| 3115 | priv->channel[1].irb=NULL; | 3115 | priv->channel[1].irb=NULL; |
| 3116 | kfree(priv); | 3116 | kfree(priv); |
| 3117 | dev_set_drvdata(&cgdev->dev, NULL); | 3117 | dev_set_drvdata(&cgdev->dev, NULL); |
| 3118 | dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL); | 3118 | dev_set_drvdata(&cgdev->cdev[READ_CHANNEL]->dev, NULL); |
| 3119 | dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL); | 3119 | dev_set_drvdata(&cgdev->cdev[WRITE_CHANNEL]->dev, NULL); |
| 3120 | put_device(&cgdev->dev); | 3120 | put_device(&cgdev->dev); |
| 3121 | 3121 | ||
| 3122 | return; | 3122 | return; |
diff --git a/drivers/s390/net/claw.h b/drivers/s390/net/claw.h index 46d59a13db12..1bc5904df19f 100644 --- a/drivers/s390/net/claw.h +++ b/drivers/s390/net/claw.h | |||
| @@ -74,8 +74,8 @@ | |||
| 74 | #define MAX_ENVELOPE_SIZE 65536 | 74 | #define MAX_ENVELOPE_SIZE 65536 |
| 75 | #define CLAW_DEFAULT_MTU_SIZE 4096 | 75 | #define CLAW_DEFAULT_MTU_SIZE 4096 |
| 76 | #define DEF_PACK_BUFSIZE 32768 | 76 | #define DEF_PACK_BUFSIZE 32768 |
| 77 | #define READ 0 | 77 | #define READ_CHANNEL 0 |
| 78 | #define WRITE 1 | 78 | #define WRITE_CHANNEL 1 |
| 79 | 79 | ||
| 80 | #define TB_TX 0 /* sk buffer handling in process */ | 80 | #define TB_TX 0 /* sk buffer handling in process */ |
| 81 | #define TB_STOP 1 /* network device stop in process */ | 81 | #define TB_STOP 1 /* network device stop in process */ |
diff --git a/drivers/s390/net/ctcm_fsms.c b/drivers/s390/net/ctcm_fsms.c index 70eb7f138414..8c921fc3511a 100644 --- a/drivers/s390/net/ctcm_fsms.c +++ b/drivers/s390/net/ctcm_fsms.c | |||
| @@ -454,7 +454,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg) | |||
| 454 | if ((fsmstate == CTC_STATE_SETUPWAIT) && | 454 | if ((fsmstate == CTC_STATE_SETUPWAIT) && |
| 455 | (ch->protocol == CTCM_PROTO_OS390)) { | 455 | (ch->protocol == CTCM_PROTO_OS390)) { |
| 456 | /* OS/390 resp. z/OS */ | 456 | /* OS/390 resp. z/OS */ |
| 457 | if (CHANNEL_DIRECTION(ch->flags) == READ) { | 457 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { |
| 458 | *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; | 458 | *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; |
| 459 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, | 459 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, |
| 460 | CTC_EVENT_TIMER, ch); | 460 | CTC_EVENT_TIMER, ch); |
| @@ -472,14 +472,14 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg) | |||
| 472 | * if in compatibility mode, since VM TCP delays the initial | 472 | * if in compatibility mode, since VM TCP delays the initial |
| 473 | * frame until it has some data to send. | 473 | * frame until it has some data to send. |
| 474 | */ | 474 | */ |
| 475 | if ((CHANNEL_DIRECTION(ch->flags) == WRITE) || | 475 | if ((CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) || |
| 476 | (ch->protocol != CTCM_PROTO_S390)) | 476 | (ch->protocol != CTCM_PROTO_S390)) |
| 477 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); | 477 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); |
| 478 | 478 | ||
| 479 | *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; | 479 | *((__u16 *)ch->trans_skb->data) = CTCM_INITIAL_BLOCKLEN; |
| 480 | ch->ccw[1].count = 2; /* Transfer only length */ | 480 | ch->ccw[1].count = 2; /* Transfer only length */ |
| 481 | 481 | ||
| 482 | fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == READ) | 482 | fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) |
| 483 | ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); | 483 | ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); |
| 484 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], | 484 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], |
| 485 | (unsigned long)ch, 0xff, 0); | 485 | (unsigned long)ch, 0xff, 0); |
| @@ -495,7 +495,7 @@ static void chx_firstio(fsm_instance *fi, int event, void *arg) | |||
| 495 | * reply from VM TCP which brings up the RX channel to it's | 495 | * reply from VM TCP which brings up the RX channel to it's |
| 496 | * final state. | 496 | * final state. |
| 497 | */ | 497 | */ |
| 498 | if ((CHANNEL_DIRECTION(ch->flags) == READ) && | 498 | if ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) && |
| 499 | (ch->protocol == CTCM_PROTO_S390)) { | 499 | (ch->protocol == CTCM_PROTO_S390)) { |
| 500 | struct net_device *dev = ch->netdev; | 500 | struct net_device *dev = ch->netdev; |
| 501 | struct ctcm_priv *priv = dev->ml_priv; | 501 | struct ctcm_priv *priv = dev->ml_priv; |
| @@ -600,15 +600,15 @@ static void ctcm_chx_start(fsm_instance *fi, int event, void *arg) | |||
| 600 | int rc; | 600 | int rc; |
| 601 | 601 | ||
| 602 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, "%s(%s): %s", | 602 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, "%s(%s): %s", |
| 603 | CTCM_FUNTAIL, ch->id, | 603 | CTCM_FUNTAIL, ch->id, |
| 604 | (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); | 604 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX"); |
| 605 | 605 | ||
| 606 | if (ch->trans_skb != NULL) { | 606 | if (ch->trans_skb != NULL) { |
| 607 | clear_normalized_cda(&ch->ccw[1]); | 607 | clear_normalized_cda(&ch->ccw[1]); |
| 608 | dev_kfree_skb(ch->trans_skb); | 608 | dev_kfree_skb(ch->trans_skb); |
| 609 | ch->trans_skb = NULL; | 609 | ch->trans_skb = NULL; |
| 610 | } | 610 | } |
| 611 | if (CHANNEL_DIRECTION(ch->flags) == READ) { | 611 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { |
| 612 | ch->ccw[1].cmd_code = CCW_CMD_READ; | 612 | ch->ccw[1].cmd_code = CCW_CMD_READ; |
| 613 | ch->ccw[1].flags = CCW_FLAG_SLI; | 613 | ch->ccw[1].flags = CCW_FLAG_SLI; |
| 614 | ch->ccw[1].count = 0; | 614 | ch->ccw[1].count = 0; |
| @@ -622,7 +622,8 @@ static void ctcm_chx_start(fsm_instance *fi, int event, void *arg) | |||
| 622 | "%s(%s): %s trans_skb alloc delayed " | 622 | "%s(%s): %s trans_skb alloc delayed " |
| 623 | "until first transfer", | 623 | "until first transfer", |
| 624 | CTCM_FUNTAIL, ch->id, | 624 | CTCM_FUNTAIL, ch->id, |
| 625 | (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); | 625 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? |
| 626 | "RX" : "TX"); | ||
| 626 | } | 627 | } |
| 627 | ch->ccw[0].cmd_code = CCW_CMD_PREPARE; | 628 | ch->ccw[0].cmd_code = CCW_CMD_PREPARE; |
| 628 | ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; | 629 | ch->ccw[0].flags = CCW_FLAG_SLI | CCW_FLAG_CC; |
| @@ -720,7 +721,7 @@ static void ctcm_chx_cleanup(fsm_instance *fi, int state, | |||
| 720 | 721 | ||
| 721 | ch->th_seg = 0x00; | 722 | ch->th_seg = 0x00; |
| 722 | ch->th_seq_num = 0x00; | 723 | ch->th_seq_num = 0x00; |
| 723 | if (CHANNEL_DIRECTION(ch->flags) == READ) { | 724 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { |
| 724 | skb_queue_purge(&ch->io_queue); | 725 | skb_queue_purge(&ch->io_queue); |
| 725 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); | 726 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); |
| 726 | } else { | 727 | } else { |
| @@ -799,7 +800,8 @@ static void ctcm_chx_setuperr(fsm_instance *fi, int event, void *arg) | |||
| 799 | fsm_newstate(fi, CTC_STATE_STARTRETRY); | 800 | fsm_newstate(fi, CTC_STATE_STARTRETRY); |
| 800 | fsm_deltimer(&ch->timer); | 801 | fsm_deltimer(&ch->timer); |
| 801 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); | 802 | fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); |
| 802 | if (!IS_MPC(ch) && (CHANNEL_DIRECTION(ch->flags) == READ)) { | 803 | if (!IS_MPC(ch) && |
| 804 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ)) { | ||
| 803 | int rc = ccw_device_halt(ch->cdev, (unsigned long)ch); | 805 | int rc = ccw_device_halt(ch->cdev, (unsigned long)ch); |
| 804 | if (rc != 0) | 806 | if (rc != 0) |
| 805 | ctcm_ccw_check_rc(ch, rc, | 807 | ctcm_ccw_check_rc(ch, rc, |
| @@ -811,10 +813,10 @@ static void ctcm_chx_setuperr(fsm_instance *fi, int event, void *arg) | |||
| 811 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT, | 813 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_CRIT, |
| 812 | "%s(%s) : %s error during %s channel setup state=%s\n", | 814 | "%s(%s) : %s error during %s channel setup state=%s\n", |
| 813 | CTCM_FUNTAIL, dev->name, ctc_ch_event_names[event], | 815 | CTCM_FUNTAIL, dev->name, ctc_ch_event_names[event], |
| 814 | (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX", | 816 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? "RX" : "TX", |
| 815 | fsm_getstate_str(fi)); | 817 | fsm_getstate_str(fi)); |
| 816 | 818 | ||
| 817 | if (CHANNEL_DIRECTION(ch->flags) == READ) { | 819 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { |
| 818 | fsm_newstate(fi, CTC_STATE_RXERR); | 820 | fsm_newstate(fi, CTC_STATE_RXERR); |
| 819 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); | 821 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); |
| 820 | } else { | 822 | } else { |
| @@ -945,7 +947,7 @@ static void ctcm_chx_rxdisc(fsm_instance *fi, int event, void *arg) | |||
| 945 | fsm_event(priv->fsm, DEV_EVENT_TXDOWN, dev); | 947 | fsm_event(priv->fsm, DEV_EVENT_TXDOWN, dev); |
| 946 | 948 | ||
| 947 | fsm_newstate(fi, CTC_STATE_DTERM); | 949 | fsm_newstate(fi, CTC_STATE_DTERM); |
| 948 | ch2 = priv->channel[WRITE]; | 950 | ch2 = priv->channel[CTCM_WRITE]; |
| 949 | fsm_newstate(ch2->fsm, CTC_STATE_DTERM); | 951 | fsm_newstate(ch2->fsm, CTC_STATE_DTERM); |
| 950 | 952 | ||
| 951 | ccw_device_halt(ch->cdev, (unsigned long)ch); | 953 | ccw_device_halt(ch->cdev, (unsigned long)ch); |
| @@ -1074,13 +1076,13 @@ static void ctcm_chx_iofatal(fsm_instance *fi, int event, void *arg) | |||
| 1074 | fsm_deltimer(&ch->timer); | 1076 | fsm_deltimer(&ch->timer); |
| 1075 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, | 1077 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
| 1076 | "%s: %s: %s unrecoverable channel error", | 1078 | "%s: %s: %s unrecoverable channel error", |
| 1077 | CTCM_FUNTAIL, ch->id, rd == READ ? "RX" : "TX"); | 1079 | CTCM_FUNTAIL, ch->id, rd == CTCM_READ ? "RX" : "TX"); |
| 1078 | 1080 | ||
| 1079 | if (IS_MPC(ch)) { | 1081 | if (IS_MPC(ch)) { |
| 1080 | priv->stats.tx_dropped++; | 1082 | priv->stats.tx_dropped++; |
| 1081 | priv->stats.tx_errors++; | 1083 | priv->stats.tx_errors++; |
| 1082 | } | 1084 | } |
| 1083 | if (rd == READ) { | 1085 | if (rd == CTCM_READ) { |
| 1084 | fsm_newstate(fi, CTC_STATE_RXERR); | 1086 | fsm_newstate(fi, CTC_STATE_RXERR); |
| 1085 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); | 1087 | fsm_event(priv->fsm, DEV_EVENT_RXDOWN, dev); |
| 1086 | } else { | 1088 | } else { |
| @@ -1503,7 +1505,7 @@ static void ctcmpc_chx_firstio(fsm_instance *fi, int event, void *arg) | |||
| 1503 | switch (fsm_getstate(fi)) { | 1505 | switch (fsm_getstate(fi)) { |
| 1504 | case CTC_STATE_STARTRETRY: | 1506 | case CTC_STATE_STARTRETRY: |
| 1505 | case CTC_STATE_SETUPWAIT: | 1507 | case CTC_STATE_SETUPWAIT: |
| 1506 | if (CHANNEL_DIRECTION(ch->flags) == READ) { | 1508 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) { |
| 1507 | ctcmpc_chx_rxidle(fi, event, arg); | 1509 | ctcmpc_chx_rxidle(fi, event, arg); |
| 1508 | } else { | 1510 | } else { |
| 1509 | fsm_newstate(fi, CTC_STATE_TXIDLE); | 1511 | fsm_newstate(fi, CTC_STATE_TXIDLE); |
| @@ -1514,7 +1516,7 @@ static void ctcmpc_chx_firstio(fsm_instance *fi, int event, void *arg) | |||
| 1514 | break; | 1516 | break; |
| 1515 | }; | 1517 | }; |
| 1516 | 1518 | ||
| 1517 | fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == READ) | 1519 | fsm_newstate(fi, (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) |
| 1518 | ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); | 1520 | ? CTC_STATE_RXINIT : CTC_STATE_TXINIT); |
| 1519 | 1521 | ||
| 1520 | done: | 1522 | done: |
| @@ -1753,8 +1755,8 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg) | |||
| 1753 | struct net_device *dev = ach->netdev; | 1755 | struct net_device *dev = ach->netdev; |
| 1754 | struct ctcm_priv *priv = dev->ml_priv; | 1756 | struct ctcm_priv *priv = dev->ml_priv; |
| 1755 | struct mpc_group *grp = priv->mpcg; | 1757 | struct mpc_group *grp = priv->mpcg; |
| 1756 | struct channel *wch = priv->channel[WRITE]; | 1758 | struct channel *wch = priv->channel[CTCM_WRITE]; |
| 1757 | struct channel *rch = priv->channel[READ]; | 1759 | struct channel *rch = priv->channel[CTCM_READ]; |
| 1758 | struct sk_buff *skb; | 1760 | struct sk_buff *skb; |
| 1759 | struct th_sweep *header; | 1761 | struct th_sweep *header; |
| 1760 | int rc = 0; | 1762 | int rc = 0; |
| @@ -2070,7 +2072,7 @@ static void dev_action_start(fsm_instance *fi, int event, void *arg) | |||
| 2070 | fsm_newstate(fi, DEV_STATE_STARTWAIT_RXTX); | 2072 | fsm_newstate(fi, DEV_STATE_STARTWAIT_RXTX); |
| 2071 | if (IS_MPC(priv)) | 2073 | if (IS_MPC(priv)) |
| 2072 | priv->mpcg->channels_terminating = 0; | 2074 | priv->mpcg->channels_terminating = 0; |
| 2073 | for (direction = READ; direction <= WRITE; direction++) { | 2075 | for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { |
| 2074 | struct channel *ch = priv->channel[direction]; | 2076 | struct channel *ch = priv->channel[direction]; |
| 2075 | fsm_event(ch->fsm, CTC_EVENT_START, ch); | 2077 | fsm_event(ch->fsm, CTC_EVENT_START, ch); |
| 2076 | } | 2078 | } |
| @@ -2092,7 +2094,7 @@ static void dev_action_stop(fsm_instance *fi, int event, void *arg) | |||
| 2092 | CTCMY_DBF_DEV_NAME(SETUP, dev, ""); | 2094 | CTCMY_DBF_DEV_NAME(SETUP, dev, ""); |
| 2093 | 2095 | ||
| 2094 | fsm_newstate(fi, DEV_STATE_STOPWAIT_RXTX); | 2096 | fsm_newstate(fi, DEV_STATE_STOPWAIT_RXTX); |
| 2095 | for (direction = READ; direction <= WRITE; direction++) { | 2097 | for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { |
| 2096 | struct channel *ch = priv->channel[direction]; | 2098 | struct channel *ch = priv->channel[direction]; |
| 2097 | fsm_event(ch->fsm, CTC_EVENT_STOP, ch); | 2099 | fsm_event(ch->fsm, CTC_EVENT_STOP, ch); |
| 2098 | ch->th_seq_num = 0x00; | 2100 | ch->th_seq_num = 0x00; |
| @@ -2183,11 +2185,11 @@ static void dev_action_chup(fsm_instance *fi, int event, void *arg) | |||
| 2183 | 2185 | ||
| 2184 | if (IS_MPC(priv)) { | 2186 | if (IS_MPC(priv)) { |
| 2185 | if (event == DEV_EVENT_RXUP) | 2187 | if (event == DEV_EVENT_RXUP) |
| 2186 | mpc_channel_action(priv->channel[READ], | 2188 | mpc_channel_action(priv->channel[CTCM_READ], |
| 2187 | READ, MPC_CHANNEL_ADD); | 2189 | CTCM_READ, MPC_CHANNEL_ADD); |
| 2188 | else | 2190 | else |
| 2189 | mpc_channel_action(priv->channel[WRITE], | 2191 | mpc_channel_action(priv->channel[CTCM_WRITE], |
| 2190 | WRITE, MPC_CHANNEL_ADD); | 2192 | CTCM_WRITE, MPC_CHANNEL_ADD); |
| 2191 | } | 2193 | } |
| 2192 | } | 2194 | } |
| 2193 | 2195 | ||
| @@ -2239,11 +2241,11 @@ static void dev_action_chdown(fsm_instance *fi, int event, void *arg) | |||
| 2239 | } | 2241 | } |
| 2240 | if (IS_MPC(priv)) { | 2242 | if (IS_MPC(priv)) { |
| 2241 | if (event == DEV_EVENT_RXDOWN) | 2243 | if (event == DEV_EVENT_RXDOWN) |
| 2242 | mpc_channel_action(priv->channel[READ], | 2244 | mpc_channel_action(priv->channel[CTCM_READ], |
| 2243 | READ, MPC_CHANNEL_REMOVE); | 2245 | CTCM_READ, MPC_CHANNEL_REMOVE); |
| 2244 | else | 2246 | else |
| 2245 | mpc_channel_action(priv->channel[WRITE], | 2247 | mpc_channel_action(priv->channel[CTCM_WRITE], |
| 2246 | WRITE, MPC_CHANNEL_REMOVE); | 2248 | CTCM_WRITE, MPC_CHANNEL_REMOVE); |
| 2247 | } | 2249 | } |
| 2248 | } | 2250 | } |
| 2249 | 2251 | ||
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 4ecafbf91211..6edf20b62de5 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c | |||
| @@ -267,7 +267,7 @@ static struct channel *channel_get(enum ctcm_channel_types type, | |||
| 267 | else { | 267 | else { |
| 268 | ch->flags |= CHANNEL_FLAGS_INUSE; | 268 | ch->flags |= CHANNEL_FLAGS_INUSE; |
| 269 | ch->flags &= ~CHANNEL_FLAGS_RWMASK; | 269 | ch->flags &= ~CHANNEL_FLAGS_RWMASK; |
| 270 | ch->flags |= (direction == WRITE) | 270 | ch->flags |= (direction == CTCM_WRITE) |
| 271 | ? CHANNEL_FLAGS_WRITE : CHANNEL_FLAGS_READ; | 271 | ? CHANNEL_FLAGS_WRITE : CHANNEL_FLAGS_READ; |
| 272 | fsm_newstate(ch->fsm, CTC_STATE_STOPPED); | 272 | fsm_newstate(ch->fsm, CTC_STATE_STOPPED); |
| 273 | } | 273 | } |
| @@ -388,7 +388,8 @@ int ctcm_ch_alloc_buffer(struct channel *ch) | |||
| 388 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, | 388 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
| 389 | "%s(%s): %s trans_skb allocation error", | 389 | "%s(%s): %s trans_skb allocation error", |
| 390 | CTCM_FUNTAIL, ch->id, | 390 | CTCM_FUNTAIL, ch->id, |
| 391 | (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); | 391 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? |
| 392 | "RX" : "TX"); | ||
| 392 | return -ENOMEM; | 393 | return -ENOMEM; |
| 393 | } | 394 | } |
| 394 | 395 | ||
| @@ -399,7 +400,8 @@ int ctcm_ch_alloc_buffer(struct channel *ch) | |||
| 399 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, | 400 | CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, |
| 400 | "%s(%s): %s set norm_cda failed", | 401 | "%s(%s): %s set norm_cda failed", |
| 401 | CTCM_FUNTAIL, ch->id, | 402 | CTCM_FUNTAIL, ch->id, |
| 402 | (CHANNEL_DIRECTION(ch->flags) == READ) ? "RX" : "TX"); | 403 | (CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? |
| 404 | "RX" : "TX"); | ||
| 403 | return -ENOMEM; | 405 | return -ENOMEM; |
| 404 | } | 406 | } |
| 405 | 407 | ||
| @@ -603,14 +605,14 @@ static void ctcmpc_send_sweep_req(struct channel *rch) | |||
| 603 | 605 | ||
| 604 | priv = dev->ml_priv; | 606 | priv = dev->ml_priv; |
| 605 | grp = priv->mpcg; | 607 | grp = priv->mpcg; |
| 606 | ch = priv->channel[WRITE]; | 608 | ch = priv->channel[CTCM_WRITE]; |
| 607 | 609 | ||
| 608 | /* sweep processing is not complete until response and request */ | 610 | /* sweep processing is not complete until response and request */ |
| 609 | /* has completed for all read channels in group */ | 611 | /* has completed for all read channels in group */ |
| 610 | if (grp->in_sweep == 0) { | 612 | if (grp->in_sweep == 0) { |
| 611 | grp->in_sweep = 1; | 613 | grp->in_sweep = 1; |
| 612 | grp->sweep_rsp_pend_num = grp->active_channels[READ]; | 614 | grp->sweep_rsp_pend_num = grp->active_channels[CTCM_READ]; |
| 613 | grp->sweep_req_pend_num = grp->active_channels[READ]; | 615 | grp->sweep_req_pend_num = grp->active_channels[CTCM_READ]; |
| 614 | } | 616 | } |
| 615 | 617 | ||
| 616 | sweep_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA); | 618 | sweep_skb = __dev_alloc_skb(MPC_BUFSIZE_DEFAULT, GFP_ATOMIC|GFP_DMA); |
| @@ -911,7 +913,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 911 | return NETDEV_TX_BUSY; | 913 | return NETDEV_TX_BUSY; |
| 912 | 914 | ||
| 913 | dev->trans_start = jiffies; | 915 | dev->trans_start = jiffies; |
| 914 | if (ctcm_transmit_skb(priv->channel[WRITE], skb) != 0) | 916 | if (ctcm_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0) |
| 915 | return NETDEV_TX_BUSY; | 917 | return NETDEV_TX_BUSY; |
| 916 | return NETDEV_TX_OK; | 918 | return NETDEV_TX_OK; |
| 917 | } | 919 | } |
| @@ -994,7 +996,7 @@ static int ctcmpc_tx(struct sk_buff *skb, struct net_device *dev) | |||
| 994 | } | 996 | } |
| 995 | 997 | ||
| 996 | dev->trans_start = jiffies; | 998 | dev->trans_start = jiffies; |
| 997 | if (ctcmpc_transmit_skb(priv->channel[WRITE], skb) != 0) { | 999 | if (ctcmpc_transmit_skb(priv->channel[CTCM_WRITE], skb) != 0) { |
| 998 | CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR, | 1000 | CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR, |
| 999 | "%s(%s): device error - dropped", | 1001 | "%s(%s): device error - dropped", |
| 1000 | CTCM_FUNTAIL, dev->name); | 1002 | CTCM_FUNTAIL, dev->name); |
| @@ -1035,7 +1037,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu) | |||
| 1035 | return -EINVAL; | 1037 | return -EINVAL; |
| 1036 | 1038 | ||
| 1037 | priv = dev->ml_priv; | 1039 | priv = dev->ml_priv; |
| 1038 | max_bufsize = priv->channel[READ]->max_bufsize; | 1040 | max_bufsize = priv->channel[CTCM_READ]->max_bufsize; |
| 1039 | 1041 | ||
| 1040 | if (IS_MPC(priv)) { | 1042 | if (IS_MPC(priv)) { |
| 1041 | if (new_mtu > max_bufsize - TH_HEADER_LENGTH) | 1043 | if (new_mtu > max_bufsize - TH_HEADER_LENGTH) |
| @@ -1226,10 +1228,10 @@ static void ctcm_irq_handler(struct ccw_device *cdev, | |||
| 1226 | priv = dev_get_drvdata(&cgdev->dev); | 1228 | priv = dev_get_drvdata(&cgdev->dev); |
| 1227 | 1229 | ||
| 1228 | /* Try to extract channel from driver data. */ | 1230 | /* Try to extract channel from driver data. */ |
| 1229 | if (priv->channel[READ]->cdev == cdev) | 1231 | if (priv->channel[CTCM_READ]->cdev == cdev) |
| 1230 | ch = priv->channel[READ]; | 1232 | ch = priv->channel[CTCM_READ]; |
| 1231 | else if (priv->channel[WRITE]->cdev == cdev) | 1233 | else if (priv->channel[CTCM_WRITE]->cdev == cdev) |
| 1232 | ch = priv->channel[WRITE]; | 1234 | ch = priv->channel[CTCM_WRITE]; |
| 1233 | else { | 1235 | else { |
| 1234 | dev_err(&cdev->dev, | 1236 | dev_err(&cdev->dev, |
| 1235 | "%s: Internal error: Can't determine channel for " | 1237 | "%s: Internal error: Can't determine channel for " |
| @@ -1587,13 +1589,13 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) | |||
| 1587 | goto out_ccw2; | 1589 | goto out_ccw2; |
| 1588 | } | 1590 | } |
| 1589 | 1591 | ||
| 1590 | for (direction = READ; direction <= WRITE; direction++) { | 1592 | for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { |
| 1591 | priv->channel[direction] = | 1593 | priv->channel[direction] = |
| 1592 | channel_get(type, direction == READ ? read_id : write_id, | 1594 | channel_get(type, direction == CTCM_READ ? |
| 1593 | direction); | 1595 | read_id : write_id, direction); |
| 1594 | if (priv->channel[direction] == NULL) { | 1596 | if (priv->channel[direction] == NULL) { |
| 1595 | if (direction == WRITE) | 1597 | if (direction == CTCM_WRITE) |
| 1596 | channel_free(priv->channel[READ]); | 1598 | channel_free(priv->channel[CTCM_READ]); |
| 1597 | goto out_dev; | 1599 | goto out_dev; |
| 1598 | } | 1600 | } |
| 1599 | priv->channel[direction]->netdev = dev; | 1601 | priv->channel[direction]->netdev = dev; |
| @@ -1617,13 +1619,13 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) | |||
| 1617 | 1619 | ||
| 1618 | dev_info(&dev->dev, | 1620 | dev_info(&dev->dev, |
| 1619 | "setup OK : r/w = %s/%s, protocol : %d\n", | 1621 | "setup OK : r/w = %s/%s, protocol : %d\n", |
| 1620 | priv->channel[READ]->id, | 1622 | priv->channel[CTCM_READ]->id, |
| 1621 | priv->channel[WRITE]->id, priv->protocol); | 1623 | priv->channel[CTCM_WRITE]->id, priv->protocol); |
| 1622 | 1624 | ||
| 1623 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, | 1625 | CTCM_DBF_TEXT_(SETUP, CTC_DBF_INFO, |
| 1624 | "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name, | 1626 | "setup(%s) OK : r/w = %s/%s, protocol : %d", dev->name, |
| 1625 | priv->channel[READ]->id, | 1627 | priv->channel[CTCM_READ]->id, |
| 1626 | priv->channel[WRITE]->id, priv->protocol); | 1628 | priv->channel[CTCM_WRITE]->id, priv->protocol); |
| 1627 | 1629 | ||
| 1628 | return 0; | 1630 | return 0; |
| 1629 | out_unregister: | 1631 | out_unregister: |
| @@ -1635,10 +1637,10 @@ out_ccw2: | |||
| 1635 | out_ccw1: | 1637 | out_ccw1: |
| 1636 | ccw_device_set_offline(cgdev->cdev[0]); | 1638 | ccw_device_set_offline(cgdev->cdev[0]); |
| 1637 | out_remove_channel2: | 1639 | out_remove_channel2: |
| 1638 | readc = channel_get(type, read_id, READ); | 1640 | readc = channel_get(type, read_id, CTCM_READ); |
| 1639 | channel_remove(readc); | 1641 | channel_remove(readc); |
| 1640 | out_remove_channel1: | 1642 | out_remove_channel1: |
| 1641 | writec = channel_get(type, write_id, WRITE); | 1643 | writec = channel_get(type, write_id, CTCM_WRITE); |
| 1642 | channel_remove(writec); | 1644 | channel_remove(writec); |
| 1643 | out_err_result: | 1645 | out_err_result: |
| 1644 | return result; | 1646 | return result; |
| @@ -1660,19 +1662,19 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev) | |||
| 1660 | if (!priv) | 1662 | if (!priv) |
| 1661 | return -ENODEV; | 1663 | return -ENODEV; |
| 1662 | 1664 | ||
| 1663 | if (priv->channel[READ]) { | 1665 | if (priv->channel[CTCM_READ]) { |
| 1664 | dev = priv->channel[READ]->netdev; | 1666 | dev = priv->channel[CTCM_READ]->netdev; |
| 1665 | CTCM_DBF_DEV(SETUP, dev, ""); | 1667 | CTCM_DBF_DEV(SETUP, dev, ""); |
| 1666 | /* Close the device */ | 1668 | /* Close the device */ |
| 1667 | ctcm_close(dev); | 1669 | ctcm_close(dev); |
| 1668 | dev->flags &= ~IFF_RUNNING; | 1670 | dev->flags &= ~IFF_RUNNING; |
| 1669 | ctcm_remove_attributes(&cgdev->dev); | 1671 | ctcm_remove_attributes(&cgdev->dev); |
| 1670 | channel_free(priv->channel[READ]); | 1672 | channel_free(priv->channel[CTCM_READ]); |
| 1671 | } else | 1673 | } else |
| 1672 | dev = NULL; | 1674 | dev = NULL; |
| 1673 | 1675 | ||
| 1674 | if (priv->channel[WRITE]) | 1676 | if (priv->channel[CTCM_WRITE]) |
| 1675 | channel_free(priv->channel[WRITE]); | 1677 | channel_free(priv->channel[CTCM_WRITE]); |
| 1676 | 1678 | ||
| 1677 | if (dev) { | 1679 | if (dev) { |
| 1678 | unregister_netdev(dev); | 1680 | unregister_netdev(dev); |
| @@ -1685,11 +1687,11 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev) | |||
| 1685 | ccw_device_set_offline(cgdev->cdev[1]); | 1687 | ccw_device_set_offline(cgdev->cdev[1]); |
| 1686 | ccw_device_set_offline(cgdev->cdev[0]); | 1688 | ccw_device_set_offline(cgdev->cdev[0]); |
| 1687 | 1689 | ||
| 1688 | if (priv->channel[READ]) | 1690 | if (priv->channel[CTCM_READ]) |
| 1689 | channel_remove(priv->channel[READ]); | 1691 | channel_remove(priv->channel[CTCM_READ]); |
| 1690 | if (priv->channel[WRITE]) | 1692 | if (priv->channel[CTCM_WRITE]) |
| 1691 | channel_remove(priv->channel[WRITE]); | 1693 | channel_remove(priv->channel[CTCM_WRITE]); |
| 1692 | priv->channel[READ] = priv->channel[WRITE] = NULL; | 1694 | priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL; |
| 1693 | 1695 | ||
| 1694 | return 0; | 1696 | return 0; |
| 1695 | 1697 | ||
| @@ -1720,11 +1722,11 @@ static int ctcm_pm_suspend(struct ccwgroup_device *gdev) | |||
| 1720 | 1722 | ||
| 1721 | if (gdev->state == CCWGROUP_OFFLINE) | 1723 | if (gdev->state == CCWGROUP_OFFLINE) |
| 1722 | return 0; | 1724 | return 0; |
| 1723 | netif_device_detach(priv->channel[READ]->netdev); | 1725 | netif_device_detach(priv->channel[CTCM_READ]->netdev); |
| 1724 | ctcm_close(priv->channel[READ]->netdev); | 1726 | ctcm_close(priv->channel[CTCM_READ]->netdev); |
| 1725 | if (!wait_event_timeout(priv->fsm->wait_q, | 1727 | if (!wait_event_timeout(priv->fsm->wait_q, |
| 1726 | fsm_getstate(priv->fsm) == DEV_STATE_STOPPED, CTCM_TIME_5_SEC)) { | 1728 | fsm_getstate(priv->fsm) == DEV_STATE_STOPPED, CTCM_TIME_5_SEC)) { |
| 1727 | netif_device_attach(priv->channel[READ]->netdev); | 1729 | netif_device_attach(priv->channel[CTCM_READ]->netdev); |
| 1728 | return -EBUSY; | 1730 | return -EBUSY; |
| 1729 | } | 1731 | } |
| 1730 | ccw_device_set_offline(gdev->cdev[1]); | 1732 | ccw_device_set_offline(gdev->cdev[1]); |
| @@ -1745,9 +1747,9 @@ static int ctcm_pm_resume(struct ccwgroup_device *gdev) | |||
| 1745 | rc = ccw_device_set_online(gdev->cdev[0]); | 1747 | rc = ccw_device_set_online(gdev->cdev[0]); |
| 1746 | if (rc) | 1748 | if (rc) |
| 1747 | goto err_out; | 1749 | goto err_out; |
| 1748 | ctcm_open(priv->channel[READ]->netdev); | 1750 | ctcm_open(priv->channel[CTCM_READ]->netdev); |
| 1749 | err_out: | 1751 | err_out: |
| 1750 | netif_device_attach(priv->channel[READ]->netdev); | 1752 | netif_device_attach(priv->channel[CTCM_READ]->netdev); |
| 1751 | return rc; | 1753 | return rc; |
| 1752 | } | 1754 | } |
| 1753 | 1755 | ||
diff --git a/drivers/s390/net/ctcm_main.h b/drivers/s390/net/ctcm_main.h index d34fa14f44e7..24d5215eb0c4 100644 --- a/drivers/s390/net/ctcm_main.h +++ b/drivers/s390/net/ctcm_main.h | |||
| @@ -111,8 +111,8 @@ enum ctcm_channel_types { | |||
| 111 | 111 | ||
| 112 | #define CTCM_INITIAL_BLOCKLEN 2 | 112 | #define CTCM_INITIAL_BLOCKLEN 2 |
| 113 | 113 | ||
| 114 | #define READ 0 | 114 | #define CTCM_READ 0 |
| 115 | #define WRITE 1 | 115 | #define CTCM_WRITE 1 |
| 116 | 116 | ||
| 117 | #define CTCM_ID_SIZE 20+3 | 117 | #define CTCM_ID_SIZE 20+3 |
| 118 | 118 | ||
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c index 87c24d2936d6..2861e78773cb 100644 --- a/drivers/s390/net/ctcm_mpc.c +++ b/drivers/s390/net/ctcm_mpc.c | |||
| @@ -419,8 +419,8 @@ void ctc_mpc_establish_connectivity(int port_num, | |||
| 419 | return; | 419 | return; |
| 420 | priv = dev->ml_priv; | 420 | priv = dev->ml_priv; |
| 421 | grp = priv->mpcg; | 421 | grp = priv->mpcg; |
| 422 | rch = priv->channel[READ]; | 422 | rch = priv->channel[CTCM_READ]; |
| 423 | wch = priv->channel[WRITE]; | 423 | wch = priv->channel[CTCM_WRITE]; |
| 424 | 424 | ||
| 425 | CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_INFO, | 425 | CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_INFO, |
| 426 | "%s(%s): state=%s", | 426 | "%s(%s): state=%s", |
| @@ -578,7 +578,7 @@ void ctc_mpc_flow_control(int port_num, int flowc) | |||
| 578 | "%s: %s: flowc = %d", | 578 | "%s: %s: flowc = %d", |
| 579 | CTCM_FUNTAIL, dev->name, flowc); | 579 | CTCM_FUNTAIL, dev->name, flowc); |
| 580 | 580 | ||
| 581 | rch = priv->channel[READ]; | 581 | rch = priv->channel[CTCM_READ]; |
| 582 | 582 | ||
| 583 | mpcg_state = fsm_getstate(grp->fsm); | 583 | mpcg_state = fsm_getstate(grp->fsm); |
| 584 | switch (flowc) { | 584 | switch (flowc) { |
| @@ -622,7 +622,7 @@ static void mpc_rcvd_sweep_resp(struct mpcg_info *mpcginfo) | |||
| 622 | struct net_device *dev = rch->netdev; | 622 | struct net_device *dev = rch->netdev; |
| 623 | struct ctcm_priv *priv = dev->ml_priv; | 623 | struct ctcm_priv *priv = dev->ml_priv; |
| 624 | struct mpc_group *grp = priv->mpcg; | 624 | struct mpc_group *grp = priv->mpcg; |
| 625 | struct channel *ch = priv->channel[WRITE]; | 625 | struct channel *ch = priv->channel[CTCM_WRITE]; |
| 626 | 626 | ||
| 627 | CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, ch, ch->id); | 627 | CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, ch, ch->id); |
| 628 | CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); | 628 | CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); |
| @@ -656,7 +656,7 @@ static void ctcmpc_send_sweep_resp(struct channel *rch) | |||
| 656 | int rc = 0; | 656 | int rc = 0; |
| 657 | struct th_sweep *header; | 657 | struct th_sweep *header; |
| 658 | struct sk_buff *sweep_skb; | 658 | struct sk_buff *sweep_skb; |
| 659 | struct channel *ch = priv->channel[WRITE]; | 659 | struct channel *ch = priv->channel[CTCM_WRITE]; |
| 660 | 660 | ||
| 661 | CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, rch, rch->id); | 661 | CTCM_PR_DEBUG("%s: ch=0x%p id=%s\n", __func__, rch, rch->id); |
| 662 | 662 | ||
| @@ -712,7 +712,7 @@ static void mpc_rcvd_sweep_req(struct mpcg_info *mpcginfo) | |||
| 712 | struct net_device *dev = rch->netdev; | 712 | struct net_device *dev = rch->netdev; |
| 713 | struct ctcm_priv *priv = dev->ml_priv; | 713 | struct ctcm_priv *priv = dev->ml_priv; |
| 714 | struct mpc_group *grp = priv->mpcg; | 714 | struct mpc_group *grp = priv->mpcg; |
| 715 | struct channel *ch = priv->channel[WRITE]; | 715 | struct channel *ch = priv->channel[CTCM_WRITE]; |
| 716 | 716 | ||
| 717 | if (do_debug) | 717 | if (do_debug) |
| 718 | CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_DEBUG, | 718 | CTCM_DBF_TEXT_(MPC_TRACE, CTC_DBF_DEBUG, |
| @@ -721,8 +721,8 @@ static void mpc_rcvd_sweep_req(struct mpcg_info *mpcginfo) | |||
| 721 | if (grp->in_sweep == 0) { | 721 | if (grp->in_sweep == 0) { |
| 722 | grp->in_sweep = 1; | 722 | grp->in_sweep = 1; |
| 723 | ctcm_test_and_set_busy(dev); | 723 | ctcm_test_and_set_busy(dev); |
| 724 | grp->sweep_req_pend_num = grp->active_channels[READ]; | 724 | grp->sweep_req_pend_num = grp->active_channels[CTCM_READ]; |
| 725 | grp->sweep_rsp_pend_num = grp->active_channels[READ]; | 725 | grp->sweep_rsp_pend_num = grp->active_channels[CTCM_READ]; |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); | 728 | CTCM_D3_DUMP((char *)mpcginfo->sweep, TH_SWEEP_LENGTH); |
| @@ -906,14 +906,14 @@ void mpc_group_ready(unsigned long adev) | |||
| 906 | fsm_newstate(grp->fsm, MPCG_STATE_READY); | 906 | fsm_newstate(grp->fsm, MPCG_STATE_READY); |
| 907 | 907 | ||
| 908 | /* Put up a read on the channel */ | 908 | /* Put up a read on the channel */ |
| 909 | ch = priv->channel[READ]; | 909 | ch = priv->channel[CTCM_READ]; |
| 910 | ch->pdu_seq = 0; | 910 | ch->pdu_seq = 0; |
| 911 | CTCM_PR_DBGDATA("ctcmpc: %s() ToDCM_pdu_seq= %08x\n" , | 911 | CTCM_PR_DBGDATA("ctcmpc: %s() ToDCM_pdu_seq= %08x\n" , |
| 912 | __func__, ch->pdu_seq); | 912 | __func__, ch->pdu_seq); |
| 913 | 913 | ||
| 914 | ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); | 914 | ctcmpc_chx_rxidle(ch->fsm, CTC_EVENT_START, ch); |
| 915 | /* Put the write channel in idle state */ | 915 | /* Put the write channel in idle state */ |
| 916 | ch = priv->channel[WRITE]; | 916 | ch = priv->channel[CTCM_WRITE]; |
| 917 | if (ch->collect_len > 0) { | 917 | if (ch->collect_len > 0) { |
| 918 | spin_lock(&ch->collect_lock); | 918 | spin_lock(&ch->collect_lock); |
| 919 | ctcm_purge_skb_queue(&ch->collect_queue); | 919 | ctcm_purge_skb_queue(&ch->collect_queue); |
| @@ -960,7 +960,8 @@ void mpc_channel_action(struct channel *ch, int direction, int action) | |||
| 960 | "%s: %i / Grp:%s total_channels=%i, active_channels: " | 960 | "%s: %i / Grp:%s total_channels=%i, active_channels: " |
| 961 | "read=%i, write=%i\n", __func__, action, | 961 | "read=%i, write=%i\n", __func__, action, |
| 962 | fsm_getstate_str(grp->fsm), grp->num_channel_paths, | 962 | fsm_getstate_str(grp->fsm), grp->num_channel_paths, |
| 963 | grp->active_channels[READ], grp->active_channels[WRITE]); | 963 | grp->active_channels[CTCM_READ], |
| 964 | grp->active_channels[CTCM_WRITE]); | ||
| 964 | 965 | ||
| 965 | if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { | 966 | if ((action == MPC_CHANNEL_ADD) && (ch->in_mpcgroup == 0)) { |
| 966 | grp->num_channel_paths++; | 967 | grp->num_channel_paths++; |
| @@ -994,10 +995,11 @@ void mpc_channel_action(struct channel *ch, int direction, int action) | |||
| 994 | grp->xid_skb->data, | 995 | grp->xid_skb->data, |
| 995 | grp->xid_skb->len); | 996 | grp->xid_skb->len); |
| 996 | 997 | ||
| 997 | ch->xid->xid2_dlc_type = ((CHANNEL_DIRECTION(ch->flags) == READ) | 998 | ch->xid->xid2_dlc_type = |
| 999 | ((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) | ||
| 998 | ? XID2_READ_SIDE : XID2_WRITE_SIDE); | 1000 | ? XID2_READ_SIDE : XID2_WRITE_SIDE); |
| 999 | 1001 | ||
| 1000 | if (CHANNEL_DIRECTION(ch->flags) == WRITE) | 1002 | if (CHANNEL_DIRECTION(ch->flags) == CTCM_WRITE) |
| 1001 | ch->xid->xid2_buf_len = 0x00; | 1003 | ch->xid->xid2_buf_len = 0x00; |
| 1002 | 1004 | ||
| 1003 | ch->xid_skb->data = ch->xid_skb_data; | 1005 | ch->xid_skb->data = ch->xid_skb_data; |
| @@ -1006,8 +1008,8 @@ void mpc_channel_action(struct channel *ch, int direction, int action) | |||
| 1006 | 1008 | ||
| 1007 | fsm_newstate(ch->fsm, CH_XID0_PENDING); | 1009 | fsm_newstate(ch->fsm, CH_XID0_PENDING); |
| 1008 | 1010 | ||
| 1009 | if ((grp->active_channels[READ] > 0) && | 1011 | if ((grp->active_channels[CTCM_READ] > 0) && |
| 1010 | (grp->active_channels[WRITE] > 0) && | 1012 | (grp->active_channels[CTCM_WRITE] > 0) && |
| 1011 | (fsm_getstate(grp->fsm) < MPCG_STATE_XID2INITW)) { | 1013 | (fsm_getstate(grp->fsm) < MPCG_STATE_XID2INITW)) { |
| 1012 | fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW); | 1014 | fsm_newstate(grp->fsm, MPCG_STATE_XID2INITW); |
| 1013 | CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_NOTICE, | 1015 | CTCM_DBF_TEXT_(MPC_SETUP, CTC_DBF_NOTICE, |
| @@ -1027,10 +1029,10 @@ void mpc_channel_action(struct channel *ch, int direction, int action) | |||
| 1027 | if (grp->channels_terminating) | 1029 | if (grp->channels_terminating) |
| 1028 | goto done; | 1030 | goto done; |
| 1029 | 1031 | ||
| 1030 | if (((grp->active_channels[READ] == 0) && | 1032 | if (((grp->active_channels[CTCM_READ] == 0) && |
| 1031 | (grp->active_channels[WRITE] > 0)) | 1033 | (grp->active_channels[CTCM_WRITE] > 0)) |
| 1032 | || ((grp->active_channels[WRITE] == 0) && | 1034 | || ((grp->active_channels[CTCM_WRITE] == 0) && |
| 1033 | (grp->active_channels[READ] > 0))) | 1035 | (grp->active_channels[CTCM_READ] > 0))) |
| 1034 | fsm_event(grp->fsm, MPCG_EVENT_INOP, dev); | 1036 | fsm_event(grp->fsm, MPCG_EVENT_INOP, dev); |
| 1035 | } | 1037 | } |
| 1036 | done: | 1038 | done: |
| @@ -1038,7 +1040,8 @@ done: | |||
| 1038 | "exit %s: %i / Grp:%s total_channels=%i, active_channels: " | 1040 | "exit %s: %i / Grp:%s total_channels=%i, active_channels: " |
| 1039 | "read=%i, write=%i\n", __func__, action, | 1041 | "read=%i, write=%i\n", __func__, action, |
| 1040 | fsm_getstate_str(grp->fsm), grp->num_channel_paths, | 1042 | fsm_getstate_str(grp->fsm), grp->num_channel_paths, |
| 1041 | grp->active_channels[READ], grp->active_channels[WRITE]); | 1043 | grp->active_channels[CTCM_READ], |
| 1044 | grp->active_channels[CTCM_WRITE]); | ||
| 1042 | 1045 | ||
| 1043 | CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); | 1046 | CTCM_PR_DEBUG("exit %s: ch=0x%p id=%s\n", __func__, ch, ch->id); |
| 1044 | } | 1047 | } |
| @@ -1392,8 +1395,8 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg) | |||
| 1392 | (grp->port_persist == 0)) | 1395 | (grp->port_persist == 0)) |
| 1393 | fsm_deltimer(&priv->restart_timer); | 1396 | fsm_deltimer(&priv->restart_timer); |
| 1394 | 1397 | ||
| 1395 | wch = priv->channel[WRITE]; | 1398 | wch = priv->channel[CTCM_WRITE]; |
| 1396 | rch = priv->channel[READ]; | 1399 | rch = priv->channel[CTCM_READ]; |
| 1397 | 1400 | ||
| 1398 | switch (grp->saved_state) { | 1401 | switch (grp->saved_state) { |
| 1399 | case MPCG_STATE_RESET: | 1402 | case MPCG_STATE_RESET: |
| @@ -1480,8 +1483,8 @@ static void mpc_action_timeout(fsm_instance *fi, int event, void *arg) | |||
| 1480 | 1483 | ||
| 1481 | priv = dev->ml_priv; | 1484 | priv = dev->ml_priv; |
| 1482 | grp = priv->mpcg; | 1485 | grp = priv->mpcg; |
| 1483 | wch = priv->channel[WRITE]; | 1486 | wch = priv->channel[CTCM_WRITE]; |
| 1484 | rch = priv->channel[READ]; | 1487 | rch = priv->channel[CTCM_READ]; |
| 1485 | 1488 | ||
| 1486 | switch (fsm_getstate(grp->fsm)) { | 1489 | switch (fsm_getstate(grp->fsm)) { |
| 1487 | case MPCG_STATE_XID2INITW: | 1490 | case MPCG_STATE_XID2INITW: |
| @@ -1586,7 +1589,7 @@ static int mpc_validate_xid(struct mpcg_info *mpcginfo) | |||
| 1586 | CTCM_D3_DUMP((char *)xid, XID2_LENGTH); | 1589 | CTCM_D3_DUMP((char *)xid, XID2_LENGTH); |
| 1587 | 1590 | ||
| 1588 | /*the received direction should be the opposite of ours */ | 1591 | /*the received direction should be the opposite of ours */ |
| 1589 | if (((CHANNEL_DIRECTION(ch->flags) == READ) ? XID2_WRITE_SIDE : | 1592 | if (((CHANNEL_DIRECTION(ch->flags) == CTCM_READ) ? XID2_WRITE_SIDE : |
| 1590 | XID2_READ_SIDE) != xid->xid2_dlc_type) { | 1593 | XID2_READ_SIDE) != xid->xid2_dlc_type) { |
| 1591 | rc = 2; | 1594 | rc = 2; |
| 1592 | /* XID REJECTED: r/w channel pairing mismatch */ | 1595 | /* XID REJECTED: r/w channel pairing mismatch */ |
| @@ -1912,7 +1915,7 @@ static void mpc_action_doxid7(fsm_instance *fsm, int event, void *arg) | |||
| 1912 | if (grp == NULL) | 1915 | if (grp == NULL) |
| 1913 | return; | 1916 | return; |
| 1914 | 1917 | ||
| 1915 | for (direction = READ; direction <= WRITE; direction++) { | 1918 | for (direction = CTCM_READ; direction <= CTCM_WRITE; direction++) { |
| 1916 | struct channel *ch = priv->channel[direction]; | 1919 | struct channel *ch = priv->channel[direction]; |
| 1917 | struct xid2 *thisxid = ch->xid; | 1920 | struct xid2 *thisxid = ch->xid; |
| 1918 | ch->xid_skb->data = ch->xid_skb_data; | 1921 | ch->xid_skb->data = ch->xid_skb_data; |
| @@ -2152,14 +2155,15 @@ static int mpc_send_qllc_discontact(struct net_device *dev) | |||
| 2152 | return -ENOMEM; | 2155 | return -ENOMEM; |
| 2153 | } | 2156 | } |
| 2154 | 2157 | ||
| 2155 | *((__u32 *)skb_push(skb, 4)) = priv->channel[READ]->pdu_seq; | 2158 | *((__u32 *)skb_push(skb, 4)) = |
| 2156 | priv->channel[READ]->pdu_seq++; | 2159 | priv->channel[CTCM_READ]->pdu_seq; |
| 2160 | priv->channel[CTCM_READ]->pdu_seq++; | ||
| 2157 | CTCM_PR_DBGDATA("ctcmpc: %s ToDCM_pdu_seq= %08x\n", | 2161 | CTCM_PR_DBGDATA("ctcmpc: %s ToDCM_pdu_seq= %08x\n", |
| 2158 | __func__, priv->channel[READ]->pdu_seq); | 2162 | __func__, priv->channel[CTCM_READ]->pdu_seq); |
| 2159 | 2163 | ||
| 2160 | /* receipt of CC03 resets anticipated sequence number on | 2164 | /* receipt of CC03 resets anticipated sequence number on |
| 2161 | receiving side */ | 2165 | receiving side */ |
| 2162 | priv->channel[READ]->pdu_seq = 0x00; | 2166 | priv->channel[CTCM_READ]->pdu_seq = 0x00; |
| 2163 | skb_reset_mac_header(skb); | 2167 | skb_reset_mac_header(skb); |
| 2164 | skb->dev = dev; | 2168 | skb->dev = dev; |
| 2165 | skb->protocol = htons(ETH_P_SNAP); | 2169 | skb->protocol = htons(ETH_P_SNAP); |
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c index 2b24550e865e..8305319b2a84 100644 --- a/drivers/s390/net/ctcm_sysfs.c +++ b/drivers/s390/net/ctcm_sysfs.c | |||
| @@ -38,8 +38,8 @@ static ssize_t ctcm_buffer_write(struct device *dev, | |||
| 38 | int bs1; | 38 | int bs1; |
| 39 | struct ctcm_priv *priv = dev_get_drvdata(dev); | 39 | struct ctcm_priv *priv = dev_get_drvdata(dev); |
| 40 | 40 | ||
| 41 | if (!(priv && priv->channel[READ] && | 41 | ndev = priv->channel[CTCM_READ]->netdev; |
| 42 | (ndev = priv->channel[READ]->netdev))) { | 42 | if (!(priv && priv->channel[CTCM_READ] && ndev)) { |
| 43 | CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev"); | 43 | CTCM_DBF_TEXT(SETUP, CTC_DBF_ERROR, "bfnondev"); |
| 44 | return -ENODEV; | 44 | return -ENODEV; |
| 45 | } | 45 | } |
| @@ -55,12 +55,12 @@ static ssize_t ctcm_buffer_write(struct device *dev, | |||
| 55 | (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2))) | 55 | (bs1 < (ndev->mtu + LL_HEADER_LENGTH + 2))) |
| 56 | goto einval; | 56 | goto einval; |
| 57 | 57 | ||
| 58 | priv->channel[READ]->max_bufsize = bs1; | 58 | priv->channel[CTCM_READ]->max_bufsize = bs1; |
| 59 | priv->channel[WRITE]->max_bufsize = bs1; | 59 | priv->channel[CTCM_WRITE]->max_bufsize = bs1; |
| 60 | if (!(ndev->flags & IFF_RUNNING)) | 60 | if (!(ndev->flags & IFF_RUNNING)) |
| 61 | ndev->mtu = bs1 - LL_HEADER_LENGTH - 2; | 61 | ndev->mtu = bs1 - LL_HEADER_LENGTH - 2; |
| 62 | priv->channel[READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; | 62 | priv->channel[CTCM_READ]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; |
| 63 | priv->channel[WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; | 63 | priv->channel[CTCM_WRITE]->flags |= CHANNEL_FLAGS_BUFSIZE_CHANGED; |
| 64 | 64 | ||
| 65 | CTCM_DBF_DEV(SETUP, ndev, buf); | 65 | CTCM_DBF_DEV(SETUP, ndev, buf); |
| 66 | return count; | 66 | return count; |
| @@ -85,9 +85,9 @@ static void ctcm_print_statistics(struct ctcm_priv *priv) | |||
| 85 | p += sprintf(p, " Device FSM state: %s\n", | 85 | p += sprintf(p, " Device FSM state: %s\n", |
| 86 | fsm_getstate_str(priv->fsm)); | 86 | fsm_getstate_str(priv->fsm)); |
| 87 | p += sprintf(p, " RX channel FSM state: %s\n", | 87 | p += sprintf(p, " RX channel FSM state: %s\n", |
| 88 | fsm_getstate_str(priv->channel[READ]->fsm)); | 88 | fsm_getstate_str(priv->channel[CTCM_READ]->fsm)); |
| 89 | p += sprintf(p, " TX channel FSM state: %s\n", | 89 | p += sprintf(p, " TX channel FSM state: %s\n", |
| 90 | fsm_getstate_str(priv->channel[WRITE]->fsm)); | 90 | fsm_getstate_str(priv->channel[CTCM_WRITE]->fsm)); |
| 91 | p += sprintf(p, " Max. TX buffer used: %ld\n", | 91 | p += sprintf(p, " Max. TX buffer used: %ld\n", |
| 92 | priv->channel[WRITE]->prof.maxmulti); | 92 | priv->channel[WRITE]->prof.maxmulti); |
| 93 | p += sprintf(p, " Max. chained SKBs: %ld\n", | 93 | p += sprintf(p, " Max. chained SKBs: %ld\n", |
| @@ -102,7 +102,7 @@ static void ctcm_print_statistics(struct ctcm_priv *priv) | |||
| 102 | priv->channel[WRITE]->prof.tx_time); | 102 | priv->channel[WRITE]->prof.tx_time); |
| 103 | 103 | ||
| 104 | printk(KERN_INFO "Statistics for %s:\n%s", | 104 | printk(KERN_INFO "Statistics for %s:\n%s", |
| 105 | priv->channel[WRITE]->netdev->name, sbuf); | 105 | priv->channel[CTCM_WRITE]->netdev->name, sbuf); |
| 106 | kfree(sbuf); | 106 | kfree(sbuf); |
| 107 | return; | 107 | return; |
| 108 | } | 108 | } |
| @@ -125,7 +125,7 @@ static ssize_t stats_write(struct device *dev, struct device_attribute *attr, | |||
| 125 | return -ENODEV; | 125 | return -ENODEV; |
| 126 | /* Reset statistics */ | 126 | /* Reset statistics */ |
| 127 | memset(&priv->channel[WRITE]->prof, 0, | 127 | memset(&priv->channel[WRITE]->prof, 0, |
| 128 | sizeof(priv->channel[WRITE]->prof)); | 128 | sizeof(priv->channel[CTCM_WRITE]->prof)); |
| 129 | return count; | 129 | return count; |
| 130 | } | 130 | } |
| 131 | 131 | ||
