diff options
Diffstat (limited to 'drivers/s390/net/claw.c')
-rw-r--r-- | drivers/s390/net/claw.c | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c index 8e4153d740f3..f1fa2483ae6b 100644 --- a/drivers/s390/net/claw.c +++ b/drivers/s390/net/claw.c | |||
@@ -63,6 +63,7 @@ | |||
63 | 63 | ||
64 | #define KMSG_COMPONENT "claw" | 64 | #define KMSG_COMPONENT "claw" |
65 | 65 | ||
66 | #include <linux/kernel_stat.h> | ||
66 | #include <asm/ccwdev.h> | 67 | #include <asm/ccwdev.h> |
67 | #include <asm/ccwgroup.h> | 68 | #include <asm/ccwgroup.h> |
68 | #include <asm/debug.h> | 69 | #include <asm/debug.h> |
@@ -263,8 +264,10 @@ static struct device *claw_root_dev; | |||
263 | /* ccwgroup table */ | 264 | /* ccwgroup table */ |
264 | 265 | ||
265 | static struct ccwgroup_driver claw_group_driver = { | 266 | static struct ccwgroup_driver claw_group_driver = { |
266 | .owner = THIS_MODULE, | 267 | .driver = { |
267 | .name = "claw", | 268 | .owner = THIS_MODULE, |
269 | .name = "claw", | ||
270 | }, | ||
268 | .max_slaves = 2, | 271 | .max_slaves = 2, |
269 | .driver_id = 0xC3D3C1E6, | 272 | .driver_id = 0xC3D3C1E6, |
270 | .probe = claw_probe, | 273 | .probe = claw_probe, |
@@ -281,8 +284,10 @@ static struct ccw_device_id claw_ids[] = { | |||
281 | MODULE_DEVICE_TABLE(ccw, claw_ids); | 284 | MODULE_DEVICE_TABLE(ccw, claw_ids); |
282 | 285 | ||
283 | static struct ccw_driver claw_ccw_driver = { | 286 | static struct ccw_driver claw_ccw_driver = { |
284 | .owner = THIS_MODULE, | 287 | .driver = { |
285 | .name = "claw", | 288 | .owner = THIS_MODULE, |
289 | .name = "claw", | ||
290 | }, | ||
286 | .ids = claw_ids, | 291 | .ids = claw_ids, |
287 | .probe = ccwgroup_probe_ccwdev, | 292 | .probe = ccwgroup_probe_ccwdev, |
288 | .remove = ccwgroup_remove_ccwdev, | 293 | .remove = ccwgroup_remove_ccwdev, |
@@ -640,6 +645,7 @@ claw_irq_handler(struct ccw_device *cdev, | |||
640 | struct claw_env *p_env; | 645 | struct claw_env *p_env; |
641 | struct chbk *p_ch_r=NULL; | 646 | struct chbk *p_ch_r=NULL; |
642 | 647 | ||
648 | kstat_cpu(smp_processor_id()).irqs[IOINT_CLW]++; | ||
643 | CLAW_DBF_TEXT(4, trace, "clawirq"); | 649 | CLAW_DBF_TEXT(4, trace, "clawirq"); |
644 | /* Bypass all 'unsolicited interrupts' */ | 650 | /* Bypass all 'unsolicited interrupts' */ |
645 | privptr = dev_get_drvdata(&cdev->dev); | 651 | privptr = dev_get_drvdata(&cdev->dev); |
@@ -773,7 +779,7 @@ claw_irq_handler(struct ccw_device *cdev, | |||
773 | case CLAW_START_WRITE: | 779 | case CLAW_START_WRITE: |
774 | if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { | 780 | if (p_ch->irb->scsw.cmd.dstat & DEV_STAT_UNIT_CHECK) { |
775 | dev_info(&cdev->dev, | 781 | dev_info(&cdev->dev, |
776 | "%s: Unit Check Occured in " | 782 | "%s: Unit Check Occurred in " |
777 | "write channel\n", dev->name); | 783 | "write channel\n", dev->name); |
778 | clear_bit(0, (void *)&p_ch->IO_active); | 784 | clear_bit(0, (void *)&p_ch->IO_active); |
779 | if (p_ch->irb->ecw[0] & 0x80) { | 785 | if (p_ch->irb->ecw[0] & 0x80) { |
@@ -839,12 +845,10 @@ claw_irq_tasklet ( unsigned long data ) | |||
839 | { | 845 | { |
840 | struct chbk * p_ch; | 846 | struct chbk * p_ch; |
841 | struct net_device *dev; | 847 | struct net_device *dev; |
842 | struct claw_privbk * privptr; | ||
843 | 848 | ||
844 | p_ch = (struct chbk *) data; | 849 | p_ch = (struct chbk *) data; |
845 | dev = (struct net_device *)p_ch->ndev; | 850 | dev = (struct net_device *)p_ch->ndev; |
846 | CLAW_DBF_TEXT(4, trace, "IRQtask"); | 851 | CLAW_DBF_TEXT(4, trace, "IRQtask"); |
847 | privptr = (struct claw_privbk *)dev->ml_priv; | ||
848 | unpack_read(dev); | 852 | unpack_read(dev); |
849 | clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a); | 853 | clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a); |
850 | CLAW_DBF_TEXT(4, trace, "TskletXt"); | 854 | CLAW_DBF_TEXT(4, trace, "TskletXt"); |
@@ -1020,7 +1024,6 @@ claw_write_next ( struct chbk * p_ch ) | |||
1020 | struct net_device *dev; | 1024 | struct net_device *dev; |
1021 | struct claw_privbk *privptr=NULL; | 1025 | struct claw_privbk *privptr=NULL; |
1022 | struct sk_buff *pk_skb; | 1026 | struct sk_buff *pk_skb; |
1023 | int rc; | ||
1024 | 1027 | ||
1025 | CLAW_DBF_TEXT(4, trace, "claw_wrt"); | 1028 | CLAW_DBF_TEXT(4, trace, "claw_wrt"); |
1026 | if (p_ch->claw_state == CLAW_STOP) | 1029 | if (p_ch->claw_state == CLAW_STOP) |
@@ -1032,7 +1035,7 @@ claw_write_next ( struct chbk * p_ch ) | |||
1032 | !skb_queue_empty(&p_ch->collect_queue)) { | 1035 | !skb_queue_empty(&p_ch->collect_queue)) { |
1033 | pk_skb = claw_pack_skb(privptr); | 1036 | pk_skb = claw_pack_skb(privptr); |
1034 | while (pk_skb != NULL) { | 1037 | while (pk_skb != NULL) { |
1035 | rc = claw_hw_tx( pk_skb, dev,1); | 1038 | claw_hw_tx(pk_skb, dev, 1); |
1036 | if (privptr->write_free_count > 0) { | 1039 | if (privptr->write_free_count > 0) { |
1037 | pk_skb = claw_pack_skb(privptr); | 1040 | pk_skb = claw_pack_skb(privptr); |
1038 | } else | 1041 | } else |
@@ -1316,15 +1319,12 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
1316 | unsigned char *pDataAddress; | 1319 | unsigned char *pDataAddress; |
1317 | struct endccw *pEnd; | 1320 | struct endccw *pEnd; |
1318 | struct ccw1 tempCCW; | 1321 | struct ccw1 tempCCW; |
1319 | struct chbk *p_ch; | ||
1320 | struct claw_env *p_env; | 1322 | struct claw_env *p_env; |
1321 | int lock; | ||
1322 | struct clawph *pk_head; | 1323 | struct clawph *pk_head; |
1323 | struct chbk *ch; | 1324 | struct chbk *ch; |
1324 | 1325 | ||
1325 | CLAW_DBF_TEXT(4, trace, "hw_tx"); | 1326 | CLAW_DBF_TEXT(4, trace, "hw_tx"); |
1326 | privptr = (struct claw_privbk *)(dev->ml_priv); | 1327 | privptr = (struct claw_privbk *)(dev->ml_priv); |
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 */ |
@@ -1505,12 +1505,6 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid) | |||
1505 | 1505 | ||
1506 | } /* endif (p_first_ccw!=NULL) */ | 1506 | } /* endif (p_first_ccw!=NULL) */ |
1507 | dev_kfree_skb_any(skb); | 1507 | dev_kfree_skb_any(skb); |
1508 | if (linkid==0) { | ||
1509 | lock=LOCK_NO; | ||
1510 | } | ||
1511 | else { | ||
1512 | lock=LOCK_YES; | ||
1513 | } | ||
1514 | claw_strt_out_IO(dev ); | 1508 | claw_strt_out_IO(dev ); |
1515 | /* if write free count is zero , set NOBUFFER */ | 1509 | /* if write free count is zero , set NOBUFFER */ |
1516 | if (privptr->write_free_count==0) { | 1510 | if (privptr->write_free_count==0) { |
@@ -2815,15 +2809,11 @@ claw_free_wrt_buf( struct net_device *dev ) | |||
2815 | { | 2809 | { |
2816 | 2810 | ||
2817 | struct claw_privbk *privptr = (struct claw_privbk *)dev->ml_priv; | 2811 | struct claw_privbk *privptr = (struct claw_privbk *)dev->ml_priv; |
2818 | struct ccwbk*p_first_ccw; | ||
2819 | struct ccwbk*p_last_ccw; | ||
2820 | struct ccwbk*p_this_ccw; | 2812 | struct ccwbk*p_this_ccw; |
2821 | struct ccwbk*p_next_ccw; | 2813 | struct ccwbk*p_next_ccw; |
2822 | 2814 | ||
2823 | CLAW_DBF_TEXT(4, trace, "freewrtb"); | 2815 | CLAW_DBF_TEXT(4, trace, "freewrtb"); |
2824 | /* scan the write queue to free any completed write packets */ | 2816 | /* scan the write queue to free any completed write packets */ |
2825 | p_first_ccw=NULL; | ||
2826 | p_last_ccw=NULL; | ||
2827 | p_this_ccw=privptr->p_write_active_first; | 2817 | p_this_ccw=privptr->p_write_active_first; |
2828 | while ( (p_this_ccw!=NULL) && (p_this_ccw->header.flag!=CLAW_PENDING)) | 2818 | while ( (p_this_ccw!=NULL) && (p_this_ccw->header.flag!=CLAW_PENDING)) |
2829 | { | 2819 | { |
@@ -3066,7 +3056,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) | |||
3066 | { | 3056 | { |
3067 | struct claw_privbk *priv; | 3057 | struct claw_privbk *priv; |
3068 | struct net_device *ndev; | 3058 | struct net_device *ndev; |
3069 | int ret; | 3059 | int ret = 0; |
3070 | 3060 | ||
3071 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); | 3061 | CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); |
3072 | priv = dev_get_drvdata(&cgdev->dev); | 3062 | priv = dev_get_drvdata(&cgdev->dev); |
@@ -3089,7 +3079,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev) | |||
3089 | } | 3079 | } |
3090 | ccw_device_set_offline(cgdev->cdev[1]); | 3080 | ccw_device_set_offline(cgdev->cdev[1]); |
3091 | ccw_device_set_offline(cgdev->cdev[0]); | 3081 | ccw_device_set_offline(cgdev->cdev[0]); |
3092 | return 0; | 3082 | return ret; |
3093 | } | 3083 | } |
3094 | 3084 | ||
3095 | static void | 3085 | static void |