aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-20 16:43:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-20 16:43:21 -0400
commit06f4e926d256d902dd9a53dcb400fd74974ce087 (patch)
tree0b438b67f5f0eff6fd617bc497a9dace6164a488 /drivers/s390
parent8e7bfcbab3825d1b404d615cb1b54f44ff81f981 (diff)
parentd93515611bbc70c2fe4db232e5feb448ed8e4cc9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits) macvlan: fix panic if lowerdev in a bond tg3: Add braces around 5906 workaround. tg3: Fix NETIF_F_LOOPBACK error macvlan: remove one synchronize_rcu() call networking: NET_CLS_ROUTE4 depends on INET irda: Fix error propagation in ircomm_lmp_connect_response() irda: Kill set but unused variable 'bytes' in irlan_check_command_param() irda: Kill set but unused variable 'clen' in ircomm_connect_indication() rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport() be2net: Kill set but unused variable 'req' in lancer_fw_download() irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication() atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined. rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer(). rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler() rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection() rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window() pkt_sched: Kill set but unused variable 'protocol' in tc_classify() isdn: capi: Use pr_debug() instead of ifdefs. tg3: Update version to 3.119 tg3: Apply rx_discards fix to 5719/5720 ... Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c as per Davem.
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/claw.c22
-rw-r--r--drivers/s390/net/ctcm_main.c2
-rw-r--r--drivers/s390/net/ctcm_mpc.c13
-rw-r--r--drivers/s390/net/lcs.c10
-rw-r--r--drivers/s390/net/netiucv.c2
-rw-r--r--drivers/s390/net/qeth_core.h26
-rw-r--r--drivers/s390/net/qeth_core_main.c150
-rw-r--r--drivers/s390/net/qeth_core_mpc.h17
-rw-r--r--drivers/s390/net/qeth_core_sys.c61
-rw-r--r--drivers/s390/net/qeth_l2_main.c21
-rw-r--r--drivers/s390/net/qeth_l3.h2
-rw-r--r--drivers/s390/net/qeth_l3_main.c261
-rw-r--r--drivers/s390/net/qeth_l3_sys.c103
13 files changed, 341 insertions, 349 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index da8aa75bb20b..f1fa2483ae6b 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -845,12 +845,10 @@ claw_irq_tasklet ( unsigned long data )
845{ 845{
846 struct chbk * p_ch; 846 struct chbk * p_ch;
847 struct net_device *dev; 847 struct net_device *dev;
848 struct claw_privbk * privptr;
849 848
850 p_ch = (struct chbk *) data; 849 p_ch = (struct chbk *) data;
851 dev = (struct net_device *)p_ch->ndev; 850 dev = (struct net_device *)p_ch->ndev;
852 CLAW_DBF_TEXT(4, trace, "IRQtask"); 851 CLAW_DBF_TEXT(4, trace, "IRQtask");
853 privptr = (struct claw_privbk *)dev->ml_priv;
854 unpack_read(dev); 852 unpack_read(dev);
855 clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a); 853 clear_bit(CLAW_BH_ACTIVE, (void *)&p_ch->flag_a);
856 CLAW_DBF_TEXT(4, trace, "TskletXt"); 854 CLAW_DBF_TEXT(4, trace, "TskletXt");
@@ -1026,7 +1024,6 @@ claw_write_next ( struct chbk * p_ch )
1026 struct net_device *dev; 1024 struct net_device *dev;
1027 struct claw_privbk *privptr=NULL; 1025 struct claw_privbk *privptr=NULL;
1028 struct sk_buff *pk_skb; 1026 struct sk_buff *pk_skb;
1029 int rc;
1030 1027
1031 CLAW_DBF_TEXT(4, trace, "claw_wrt"); 1028 CLAW_DBF_TEXT(4, trace, "claw_wrt");
1032 if (p_ch->claw_state == CLAW_STOP) 1029 if (p_ch->claw_state == CLAW_STOP)
@@ -1038,7 +1035,7 @@ claw_write_next ( struct chbk * p_ch )
1038 !skb_queue_empty(&p_ch->collect_queue)) { 1035 !skb_queue_empty(&p_ch->collect_queue)) {
1039 pk_skb = claw_pack_skb(privptr); 1036 pk_skb = claw_pack_skb(privptr);
1040 while (pk_skb != NULL) { 1037 while (pk_skb != NULL) {
1041 rc = claw_hw_tx( pk_skb, dev,1); 1038 claw_hw_tx(pk_skb, dev, 1);
1042 if (privptr->write_free_count > 0) { 1039 if (privptr->write_free_count > 0) {
1043 pk_skb = claw_pack_skb(privptr); 1040 pk_skb = claw_pack_skb(privptr);
1044 } else 1041 } else
@@ -1322,15 +1319,12 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid)
1322 unsigned char *pDataAddress; 1319 unsigned char *pDataAddress;
1323 struct endccw *pEnd; 1320 struct endccw *pEnd;
1324 struct ccw1 tempCCW; 1321 struct ccw1 tempCCW;
1325 struct chbk *p_ch;
1326 struct claw_env *p_env; 1322 struct claw_env *p_env;
1327 int lock;
1328 struct clawph *pk_head; 1323 struct clawph *pk_head;
1329 struct chbk *ch; 1324 struct chbk *ch;
1330 1325
1331 CLAW_DBF_TEXT(4, trace, "hw_tx"); 1326 CLAW_DBF_TEXT(4, trace, "hw_tx");
1332 privptr = (struct claw_privbk *)(dev->ml_priv); 1327 privptr = (struct claw_privbk *)(dev->ml_priv);
1333 p_ch = (struct chbk *)&privptr->channel[WRITE_CHANNEL];
1334 p_env =privptr->p_env; 1328 p_env =privptr->p_env;
1335 claw_free_wrt_buf(dev); /* Clean up free chain if posible */ 1329 claw_free_wrt_buf(dev); /* Clean up free chain if posible */
1336 /* scan the write queue to free any completed write packets */ 1330 /* scan the write queue to free any completed write packets */
@@ -1511,12 +1505,6 @@ claw_hw_tx(struct sk_buff *skb, struct net_device *dev, long linkid)
1511 1505
1512 } /* endif (p_first_ccw!=NULL) */ 1506 } /* endif (p_first_ccw!=NULL) */
1513 dev_kfree_skb_any(skb); 1507 dev_kfree_skb_any(skb);
1514 if (linkid==0) {
1515 lock=LOCK_NO;
1516 }
1517 else {
1518 lock=LOCK_YES;
1519 }
1520 claw_strt_out_IO(dev ); 1508 claw_strt_out_IO(dev );
1521 /* if write free count is zero , set NOBUFFER */ 1509 /* if write free count is zero , set NOBUFFER */
1522 if (privptr->write_free_count==0) { 1510 if (privptr->write_free_count==0) {
@@ -2821,15 +2809,11 @@ claw_free_wrt_buf( struct net_device *dev )
2821{ 2809{
2822 2810
2823 struct claw_privbk *privptr = (struct claw_privbk *)dev->ml_priv; 2811 struct claw_privbk *privptr = (struct claw_privbk *)dev->ml_priv;
2824 struct ccwbk*p_first_ccw;
2825 struct ccwbk*p_last_ccw;
2826 struct ccwbk*p_this_ccw; 2812 struct ccwbk*p_this_ccw;
2827 struct ccwbk*p_next_ccw; 2813 struct ccwbk*p_next_ccw;
2828 2814
2829 CLAW_DBF_TEXT(4, trace, "freewrtb"); 2815 CLAW_DBF_TEXT(4, trace, "freewrtb");
2830 /* scan the write queue to free any completed write packets */ 2816 /* scan the write queue to free any completed write packets */
2831 p_first_ccw=NULL;
2832 p_last_ccw=NULL;
2833 p_this_ccw=privptr->p_write_active_first; 2817 p_this_ccw=privptr->p_write_active_first;
2834 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))
2835 { 2819 {
@@ -3072,7 +3056,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev)
3072{ 3056{
3073 struct claw_privbk *priv; 3057 struct claw_privbk *priv;
3074 struct net_device *ndev; 3058 struct net_device *ndev;
3075 int ret; 3059 int ret = 0;
3076 3060
3077 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev)); 3061 CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
3078 priv = dev_get_drvdata(&cgdev->dev); 3062 priv = dev_get_drvdata(&cgdev->dev);
@@ -3095,7 +3079,7 @@ claw_shutdown_device(struct ccwgroup_device *cgdev)
3095 } 3079 }
3096 ccw_device_set_offline(cgdev->cdev[1]); 3080 ccw_device_set_offline(cgdev->cdev[1]);
3097 ccw_device_set_offline(cgdev->cdev[0]); 3081 ccw_device_set_offline(cgdev->cdev[0]);
3098 return 0; 3082 return ret;
3099} 3083}
3100 3084
3101static void 3085static void
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index c189296763a4..426787efc492 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -672,7 +672,6 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
672 int ccw_idx; 672 int ccw_idx;
673 unsigned long hi; 673 unsigned long hi;
674 unsigned long saveflags = 0; /* avoids compiler warning */ 674 unsigned long saveflags = 0; /* avoids compiler warning */
675 __u16 block_len;
676 675
677 CTCM_PR_DEBUG("Enter %s: %s, cp=%i ch=0x%p id=%s state=%s\n", 676 CTCM_PR_DEBUG("Enter %s: %s, cp=%i ch=0x%p id=%s state=%s\n",
678 __func__, dev->name, smp_processor_id(), ch, 677 __func__, dev->name, smp_processor_id(), ch,
@@ -719,7 +718,6 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
719 */ 718 */
720 atomic_inc(&skb->users); 719 atomic_inc(&skb->users);
721 720
722 block_len = skb->len + TH_HEADER_LENGTH + PDU_HEADER_LENGTH;
723 /* 721 /*
724 * IDAL support in CTCM is broken, so we have to 722 * IDAL support in CTCM is broken, so we have to
725 * care about skb's above 2G ourselves. 723 * care about skb's above 2G ourselves.
diff --git a/drivers/s390/net/ctcm_mpc.c b/drivers/s390/net/ctcm_mpc.c
index b64881f33f23..da4c747335e7 100644
--- a/drivers/s390/net/ctcm_mpc.c
+++ b/drivers/s390/net/ctcm_mpc.c
@@ -653,7 +653,6 @@ static void ctcmpc_send_sweep_resp(struct channel *rch)
653 struct net_device *dev = rch->netdev; 653 struct net_device *dev = rch->netdev;
654 struct ctcm_priv *priv = dev->ml_priv; 654 struct ctcm_priv *priv = dev->ml_priv;
655 struct mpc_group *grp = priv->mpcg; 655 struct mpc_group *grp = priv->mpcg;
656 int rc = 0;
657 struct th_sweep *header; 656 struct th_sweep *header;
658 struct sk_buff *sweep_skb; 657 struct sk_buff *sweep_skb;
659 struct channel *ch = priv->channel[CTCM_WRITE]; 658 struct channel *ch = priv->channel[CTCM_WRITE];
@@ -665,16 +664,14 @@ static void ctcmpc_send_sweep_resp(struct channel *rch)
665 CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR, 664 CTCM_DBF_TEXT_(MPC_ERROR, CTC_DBF_ERROR,
666 "%s(%s): sweep_skb allocation ERROR\n", 665 "%s(%s): sweep_skb allocation ERROR\n",
667 CTCM_FUNTAIL, rch->id); 666 CTCM_FUNTAIL, rch->id);
668 rc = -ENOMEM; 667 goto done;
669 goto done;
670 } 668 }
671 669
672 header = kmalloc(sizeof(struct th_sweep), gfp_type()); 670 header = kmalloc(sizeof(struct th_sweep), gfp_type());
673 671
674 if (!header) { 672 if (!header) {
675 dev_kfree_skb_any(sweep_skb); 673 dev_kfree_skb_any(sweep_skb);
676 rc = -ENOMEM; 674 goto done;
677 goto done;
678 } 675 }
679 676
680 header->th.th_seg = 0x00 ; 677 header->th.th_seg = 0x00 ;
@@ -1370,8 +1367,7 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg)
1370 struct net_device *dev = arg; 1367 struct net_device *dev = arg;
1371 struct ctcm_priv *priv; 1368 struct ctcm_priv *priv;
1372 struct mpc_group *grp; 1369 struct mpc_group *grp;
1373 int rc = 0; 1370 struct channel *wch;
1374 struct channel *wch, *rch;
1375 1371
1376 BUG_ON(dev == NULL); 1372 BUG_ON(dev == NULL);
1377 CTCM_PR_DEBUG("Enter %s: %s\n", __func__, dev->name); 1373 CTCM_PR_DEBUG("Enter %s: %s\n", __func__, dev->name);
@@ -1396,7 +1392,6 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg)
1396 fsm_deltimer(&priv->restart_timer); 1392 fsm_deltimer(&priv->restart_timer);
1397 1393
1398 wch = priv->channel[CTCM_WRITE]; 1394 wch = priv->channel[CTCM_WRITE];
1399 rch = priv->channel[CTCM_READ];
1400 1395
1401 switch (grp->saved_state) { 1396 switch (grp->saved_state) {
1402 case MPCG_STATE_RESET: 1397 case MPCG_STATE_RESET:
@@ -1435,7 +1430,7 @@ static void mpc_action_go_inop(fsm_instance *fi, int event, void *arg)
1435 1430
1436 if (grp->send_qllc_disc == 1) { 1431 if (grp->send_qllc_disc == 1) {
1437 grp->send_qllc_disc = 0; 1432 grp->send_qllc_disc = 0;
1438 rc = mpc_send_qllc_discontact(dev); 1433 mpc_send_qllc_discontact(dev);
1439 } 1434 }
1440 1435
1441 /* DO NOT issue DEV_EVENT_STOP directly out of this code */ 1436 /* DO NOT issue DEV_EVENT_STOP directly out of this code */
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 49d1cfc3217e..c3b8064a102d 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1483,7 +1483,6 @@ lcs_tasklet(unsigned long data)
1483 struct lcs_channel *channel; 1483 struct lcs_channel *channel;
1484 struct lcs_buffer *iob; 1484 struct lcs_buffer *iob;
1485 int buf_idx; 1485 int buf_idx;
1486 int rc;
1487 1486
1488 channel = (struct lcs_channel *) data; 1487 channel = (struct lcs_channel *) data;
1489 LCS_DBF_TEXT_(5, trace, "tlet%s", dev_name(&channel->ccwdev->dev)); 1488 LCS_DBF_TEXT_(5, trace, "tlet%s", dev_name(&channel->ccwdev->dev));
@@ -1500,14 +1499,11 @@ lcs_tasklet(unsigned long data)
1500 channel->buf_idx = buf_idx; 1499 channel->buf_idx = buf_idx;
1501 1500
1502 if (channel->state == LCS_CH_STATE_STOPPED) 1501 if (channel->state == LCS_CH_STATE_STOPPED)
1503 // FIXME: what if rc != 0 ?? 1502 lcs_start_channel(channel);
1504 rc = lcs_start_channel(channel);
1505 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); 1503 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
1506 if (channel->state == LCS_CH_STATE_SUSPENDED && 1504 if (channel->state == LCS_CH_STATE_SUSPENDED &&
1507 channel->iob[channel->io_idx].state == LCS_BUF_STATE_READY) { 1505 channel->iob[channel->io_idx].state == LCS_BUF_STATE_READY)
1508 // FIXME: what if rc != 0 ?? 1506 __lcs_resume_channel(channel);
1509 rc = __lcs_resume_channel(channel);
1510 }
1511 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); 1507 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
1512 1508
1513 /* Something happened on the channel. Wake up waiters. */ 1509 /* Something happened on the channel. Wake up waiters. */
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index b6a6356d09b3..3251333a23df 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1994,8 +1994,6 @@ static struct net_device *netiucv_init_netdevice(char *username)
1994 netiucv_setup_netdevice); 1994 netiucv_setup_netdevice);
1995 if (!dev) 1995 if (!dev)
1996 return NULL; 1996 return NULL;
1997 if (dev_alloc_name(dev, dev->name) < 0)
1998 goto out_netdev;
1999 1997
2000 privptr = netdev_priv(dev); 1998 privptr = netdev_priv(dev);
2001 privptr->fsm = init_fsm("netiucvdev", dev_state_names, 1999 privptr->fsm = init_fsm("netiucvdev", dev_state_names,
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index af3f7b095647..55c6aa1c9704 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -407,12 +407,6 @@ struct qeth_qdio_q {
407 int next_buf_to_init; 407 int next_buf_to_init;
408} __attribute__ ((aligned(256))); 408} __attribute__ ((aligned(256)));
409 409
410/* possible types of qeth large_send support */
411enum qeth_large_send_types {
412 QETH_LARGE_SEND_NO,
413 QETH_LARGE_SEND_TSO,
414};
415
416struct qeth_qdio_out_buffer { 410struct qeth_qdio_out_buffer {
417 struct qdio_buffer *buffer; 411 struct qdio_buffer *buffer;
418 atomic_t state; 412 atomic_t state;
@@ -637,6 +631,8 @@ struct qeth_card_info {
637 __u32 csum_mask; 631 __u32 csum_mask;
638 __u32 tx_csum_mask; 632 __u32 tx_csum_mask;
639 enum qeth_ipa_promisc_modes promisc_mode; 633 enum qeth_ipa_promisc_modes promisc_mode;
634 __u32 diagass_support;
635 __u32 hwtrap;
640}; 636};
641 637
642struct qeth_card_options { 638struct qeth_card_options {
@@ -645,13 +641,11 @@ struct qeth_card_options {
645 struct qeth_ipa_info adp; /*Adapter parameters*/ 641 struct qeth_ipa_info adp; /*Adapter parameters*/
646 struct qeth_routing_info route6; 642 struct qeth_routing_info route6;
647 struct qeth_ipa_info ipa6; 643 struct qeth_ipa_info ipa6;
648 enum qeth_checksum_types checksum_type;
649 int broadcast_mode; 644 int broadcast_mode;
650 int macaddr_mode; 645 int macaddr_mode;
651 int fake_broadcast; 646 int fake_broadcast;
652 int add_hhlen; 647 int add_hhlen;
653 int layer2; 648 int layer2;
654 enum qeth_large_send_types large_send;
655 int performance_stats; 649 int performance_stats;
656 int rx_sg_cb; 650 int rx_sg_cb;
657 enum qeth_ipa_isolation_modes isolation; 651 enum qeth_ipa_isolation_modes isolation;
@@ -760,6 +754,14 @@ struct qeth_card_list_struct {
760 rwlock_t rwlock; 754 rwlock_t rwlock;
761}; 755};
762 756
757struct qeth_trap_id {
758 __u16 lparnr;
759 char vmname[8];
760 __u8 chpid;
761 __u8 ssid;
762 __u16 devno;
763} __packed;
764
763/*some helper functions*/ 765/*some helper functions*/
764#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "") 766#define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
765 767
@@ -794,6 +796,12 @@ static inline void qeth_put_buffer_pool_entry(struct qeth_card *card,
794 list_add_tail(&entry->list, &card->qdio.in_buf_pool.entry_list); 796 list_add_tail(&entry->list, &card->qdio.in_buf_pool.entry_list);
795} 797}
796 798
799static inline int qeth_is_diagass_supported(struct qeth_card *card,
800 enum qeth_diags_cmds cmd)
801{
802 return card->info.diagass_support & (__u32)cmd;
803}
804
797extern struct ccwgroup_driver qeth_l2_ccwgroup_driver; 805extern struct ccwgroup_driver qeth_l2_ccwgroup_driver;
798extern struct ccwgroup_driver qeth_l3_ccwgroup_driver; 806extern struct ccwgroup_driver qeth_l3_ccwgroup_driver;
799const char *qeth_get_cardname_short(struct qeth_card *); 807const char *qeth_get_cardname_short(struct qeth_card *);
@@ -879,6 +887,8 @@ void qeth_dbf_longtext(debug_info_t *id, int level, char *text, ...);
879int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *); 887int qeth_core_ethtool_get_settings(struct net_device *, struct ethtool_cmd *);
880int qeth_set_access_ctrl_online(struct qeth_card *card); 888int qeth_set_access_ctrl_online(struct qeth_card *card);
881int qeth_hdr_chk_and_bounce(struct sk_buff *, int); 889int qeth_hdr_chk_and_bounce(struct sk_buff *, int);
890int qeth_hw_trap(struct qeth_card *, enum qeth_diags_trap_action);
891int qeth_query_ipassists(struct qeth_card *, enum qeth_prot_versions prot);
882 892
883/* exports for OSN */ 893/* exports for OSN */
884int qeth_osn_assist(struct net_device *, void *, int); 894int qeth_osn_assist(struct net_device *, void *, int);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 85cc53117ea6..503678a30981 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -24,6 +24,7 @@
24 24
25#include <asm/ebcdic.h> 25#include <asm/ebcdic.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/sysinfo.h>
27 28
28#include "qeth_core.h" 29#include "qeth_core.h"
29 30
@@ -349,6 +350,8 @@ static struct qeth_ipa_cmd *qeth_check_ipa_data(struct qeth_card *card,
349 card->info.chpid); 350 card->info.chpid);
350 netif_carrier_on(card->dev); 351 netif_carrier_on(card->dev);
351 card->lan_online = 1; 352 card->lan_online = 1;
353 if (card->info.hwtrap)
354 card->info.hwtrap = 2;
352 qeth_schedule_recovery(card); 355 qeth_schedule_recovery(card);
353 return NULL; 356 return NULL;
354 case IPA_CMD_MODCCID: 357 case IPA_CMD_MODCCID:
@@ -1039,7 +1042,6 @@ static void qeth_set_intial_options(struct qeth_card *card)
1039{ 1042{
1040 card->options.route4.type = NO_ROUTER; 1043 card->options.route4.type = NO_ROUTER;
1041 card->options.route6.type = NO_ROUTER; 1044 card->options.route6.type = NO_ROUTER;
1042 card->options.checksum_type = QETH_CHECKSUM_DEFAULT;
1043 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS; 1045 card->options.broadcast_mode = QETH_TR_BROADCAST_ALLRINGS;
1044 card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL; 1046 card->options.macaddr_mode = QETH_TR_MACADDR_NONCANONICAL;
1045 card->options.fake_broadcast = 0; 1047 card->options.fake_broadcast = 0;
@@ -2574,6 +2576,142 @@ int qeth_query_setadapterparms(struct qeth_card *card)
2574} 2576}
2575EXPORT_SYMBOL_GPL(qeth_query_setadapterparms); 2577EXPORT_SYMBOL_GPL(qeth_query_setadapterparms);
2576 2578
2579static int qeth_query_ipassists_cb(struct qeth_card *card,
2580 struct qeth_reply *reply, unsigned long data)
2581{
2582 struct qeth_ipa_cmd *cmd;
2583
2584 QETH_DBF_TEXT(SETUP, 2, "qipasscb");
2585
2586 cmd = (struct qeth_ipa_cmd *) data;
2587 if (cmd->hdr.prot_version == QETH_PROT_IPV4) {
2588 card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported;
2589 card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled;
2590 } else {
2591 card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported;
2592 card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
2593 }
2594 QETH_DBF_TEXT(SETUP, 2, "suppenbl");
2595 QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_supported);
2596 QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_enabled);
2597 return 0;
2598}
2599
2600int qeth_query_ipassists(struct qeth_card *card, enum qeth_prot_versions prot)
2601{
2602 int rc;
2603 struct qeth_cmd_buffer *iob;
2604
2605 QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot);
2606 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot);
2607 rc = qeth_send_ipa_cmd(card, iob, qeth_query_ipassists_cb, NULL);
2608 return rc;
2609}
2610EXPORT_SYMBOL_GPL(qeth_query_ipassists);
2611
2612static int qeth_query_setdiagass_cb(struct qeth_card *card,
2613 struct qeth_reply *reply, unsigned long data)
2614{
2615 struct qeth_ipa_cmd *cmd;
2616 __u16 rc;
2617
2618 cmd = (struct qeth_ipa_cmd *)data;
2619 rc = cmd->hdr.return_code;
2620 if (rc)
2621 QETH_CARD_TEXT_(card, 2, "diagq:%x", rc);
2622 else
2623 card->info.diagass_support = cmd->data.diagass.ext;
2624 return 0;
2625}
2626
2627static int qeth_query_setdiagass(struct qeth_card *card)
2628{
2629 struct qeth_cmd_buffer *iob;
2630 struct qeth_ipa_cmd *cmd;
2631
2632 QETH_DBF_TEXT(SETUP, 2, "qdiagass");
2633 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
2634 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
2635 cmd->data.diagass.subcmd_len = 16;
2636 cmd->data.diagass.subcmd = QETH_DIAGS_CMD_QUERY;
2637 return qeth_send_ipa_cmd(card, iob, qeth_query_setdiagass_cb, NULL);
2638}
2639
2640static void qeth_get_trap_id(struct qeth_card *card, struct qeth_trap_id *tid)
2641{
2642 unsigned long info = get_zeroed_page(GFP_KERNEL);
2643 struct sysinfo_2_2_2 *info222 = (struct sysinfo_2_2_2 *)info;
2644 struct sysinfo_3_2_2 *info322 = (struct sysinfo_3_2_2 *)info;
2645 struct ccw_dev_id ccwid;
2646 int level, rc;
2647
2648 tid->chpid = card->info.chpid;
2649 ccw_device_get_id(CARD_RDEV(card), &ccwid);
2650 tid->ssid = ccwid.ssid;
2651 tid->devno = ccwid.devno;
2652 if (!info)
2653 return;
2654
2655 rc = stsi(NULL, 0, 0, 0);
2656 if (rc == -ENOSYS)
2657 level = rc;
2658 else
2659 level = (((unsigned int) rc) >> 28);
2660
2661 if ((level >= 2) && (stsi(info222, 2, 2, 2) != -ENOSYS))
2662 tid->lparnr = info222->lpar_number;
2663
2664 if ((level >= 3) && (stsi(info322, 3, 2, 2) != -ENOSYS)) {
2665 EBCASC(info322->vm[0].name, sizeof(info322->vm[0].name));
2666 memcpy(tid->vmname, info322->vm[0].name, sizeof(tid->vmname));
2667 }
2668 free_page(info);
2669 return;
2670}
2671
2672static int qeth_hw_trap_cb(struct qeth_card *card,
2673 struct qeth_reply *reply, unsigned long data)
2674{
2675 struct qeth_ipa_cmd *cmd;
2676 __u16 rc;
2677
2678 cmd = (struct qeth_ipa_cmd *)data;
2679 rc = cmd->hdr.return_code;
2680 if (rc)
2681 QETH_CARD_TEXT_(card, 2, "trapc:%x", rc);
2682 return 0;
2683}
2684
2685int qeth_hw_trap(struct qeth_card *card, enum qeth_diags_trap_action action)
2686{
2687 struct qeth_cmd_buffer *iob;
2688 struct qeth_ipa_cmd *cmd;
2689
2690 QETH_DBF_TEXT(SETUP, 2, "diagtrap");
2691 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0);
2692 cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE);
2693 cmd->data.diagass.subcmd_len = 80;
2694 cmd->data.diagass.subcmd = QETH_DIAGS_CMD_TRAP;
2695 cmd->data.diagass.type = 1;
2696 cmd->data.diagass.action = action;
2697 switch (action) {
2698 case QETH_DIAGS_TRAP_ARM:
2699 cmd->data.diagass.options = 0x0003;
2700 cmd->data.diagass.ext = 0x00010000 +
2701 sizeof(struct qeth_trap_id);
2702 qeth_get_trap_id(card,
2703 (struct qeth_trap_id *)cmd->data.diagass.cdata);
2704 break;
2705 case QETH_DIAGS_TRAP_DISARM:
2706 cmd->data.diagass.options = 0x0001;
2707 break;
2708 case QETH_DIAGS_TRAP_CAPTURE:
2709 break;
2710 }
2711 return qeth_send_ipa_cmd(card, iob, qeth_hw_trap_cb, NULL);
2712}
2713EXPORT_SYMBOL_GPL(qeth_hw_trap);
2714
2577int qeth_check_qdio_errors(struct qeth_card *card, struct qdio_buffer *buf, 2715int qeth_check_qdio_errors(struct qeth_card *card, struct qdio_buffer *buf,
2578 unsigned int qdio_error, const char *dbftext) 2716 unsigned int qdio_error, const char *dbftext)
2579{ 2717{
@@ -3903,6 +4041,7 @@ MODULE_DEVICE_TABLE(ccw, qeth_ids);
3903 4041
3904static struct ccw_driver qeth_ccw_driver = { 4042static struct ccw_driver qeth_ccw_driver = {
3905 .driver = { 4043 .driver = {
4044 .owner = THIS_MODULE,
3906 .name = "qeth", 4045 .name = "qeth",
3907 }, 4046 },
3908 .ids = qeth_ids, 4047 .ids = qeth_ids,
@@ -3984,6 +4123,15 @@ retriable:
3984 QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc); 4123 QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
3985 goto out; 4124 goto out;
3986 } 4125 }
4126
4127 card->options.ipa4.supported_funcs = 0;
4128 card->options.adp.supported_funcs = 0;
4129 card->info.diagass_support = 0;
4130 qeth_query_ipassists(card, QETH_PROT_IPV4);
4131 if (qeth_is_supported(card, IPA_SETADAPTERPARMS))
4132 qeth_query_setadapterparms(card);
4133 if (qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST))
4134 qeth_query_setdiagass(card);
3987 return 0; 4135 return 0;
3988out: 4136out:
3989 dev_warn(&card->gdev->dev, "The qeth device driver failed to recover " 4137 dev_warn(&card->gdev->dev, "The qeth device driver failed to recover "
diff --git a/drivers/s390/net/qeth_core_mpc.h b/drivers/s390/net/qeth_core_mpc.h
index 07d588867b57..e5a9d1c03839 100644
--- a/drivers/s390/net/qeth_core_mpc.h
+++ b/drivers/s390/net/qeth_core_mpc.h
@@ -80,14 +80,6 @@ enum qeth_tr_broadcast_modes {
80 QETH_TR_BROADCAST_LOCAL = 1, 80 QETH_TR_BROADCAST_LOCAL = 1,
81}; 81};
82 82
83/* these values match CHECKSUM_* in include/linux/skbuff.h */
84enum qeth_checksum_types {
85 SW_CHECKSUMMING = 0, /* TODO: set to bit flag used in IPA Command */
86 HW_CHECKSUMMING = 1,
87 NO_CHECKSUMMING = 2,
88};
89#define QETH_CHECKSUM_DEFAULT SW_CHECKSUMMING
90
91/* 83/*
92 * Routing stuff 84 * Routing stuff
93 */ 85 */
@@ -456,6 +448,12 @@ enum qeth_diags_trace_cmds {
456 QETH_DIAGS_CMD_TRACE_QUERY = 0x0010, 448 QETH_DIAGS_CMD_TRACE_QUERY = 0x0010,
457}; 449};
458 450
451enum qeth_diags_trap_action {
452 QETH_DIAGS_TRAP_ARM = 0x01,
453 QETH_DIAGS_TRAP_DISARM = 0x02,
454 QETH_DIAGS_TRAP_CAPTURE = 0x04,
455};
456
459struct qeth_ipacmd_diagass { 457struct qeth_ipacmd_diagass {
460 __u32 host_tod2; 458 __u32 host_tod2;
461 __u32:32; 459 __u32:32;
@@ -465,7 +463,8 @@ struct qeth_ipacmd_diagass {
465 __u8 type; 463 __u8 type;
466 __u8 action; 464 __u8 action;
467 __u16 options; 465 __u16 options;
468 __u32:32; 466 __u32 ext;
467 __u8 cdata[64];
469} __attribute__ ((packed)); 468} __attribute__ ((packed));
470 469
471/* Header for each IPA command */ 470/* Header for each IPA command */
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index b5e967cf7e2d..0a8e86c1b0ea 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -530,6 +530,66 @@ out:
530static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show, 530static DEVICE_ATTR(isolation, 0644, qeth_dev_isolation_show,
531 qeth_dev_isolation_store); 531 qeth_dev_isolation_store);
532 532
533static ssize_t qeth_hw_trap_show(struct device *dev,
534 struct device_attribute *attr, char *buf)
535{
536 struct qeth_card *card = dev_get_drvdata(dev);
537
538 if (!card)
539 return -EINVAL;
540 if (card->info.hwtrap)
541 return snprintf(buf, 5, "arm\n");
542 else
543 return snprintf(buf, 8, "disarm\n");
544}
545
546static ssize_t qeth_hw_trap_store(struct device *dev,
547 struct device_attribute *attr, const char *buf, size_t count)
548{
549 struct qeth_card *card = dev_get_drvdata(dev);
550 int rc = 0;
551 char *tmp, *curtoken;
552 int state = 0;
553 curtoken = (char *)buf;
554
555 if (!card)
556 return -EINVAL;
557
558 mutex_lock(&card->conf_mutex);
559 if (card->state == CARD_STATE_SOFTSETUP || card->state == CARD_STATE_UP)
560 state = 1;
561 tmp = strsep(&curtoken, "\n");
562
563 if (!strcmp(tmp, "arm") && !card->info.hwtrap) {
564 if (state) {
565 if (qeth_is_diagass_supported(card,
566 QETH_DIAGS_CMD_TRAP)) {
567 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM);
568 if (!rc)
569 card->info.hwtrap = 1;
570 } else
571 rc = -EINVAL;
572 } else
573 card->info.hwtrap = 1;
574 } else if (!strcmp(tmp, "disarm") && card->info.hwtrap) {
575 if (state) {
576 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
577 if (!rc)
578 card->info.hwtrap = 0;
579 } else
580 card->info.hwtrap = 0;
581 } else if (!strcmp(tmp, "trap") && state && card->info.hwtrap)
582 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE);
583 else
584 rc = -EINVAL;
585
586 mutex_unlock(&card->conf_mutex);
587 return rc ? rc : count;
588}
589
590static DEVICE_ATTR(hw_trap, 0644, qeth_hw_trap_show,
591 qeth_hw_trap_store);
592
533static ssize_t qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value) 593static ssize_t qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value)
534{ 594{
535 595
@@ -653,6 +713,7 @@ static struct attribute *qeth_device_attrs[] = {
653 &dev_attr_performance_stats.attr, 713 &dev_attr_performance_stats.attr,
654 &dev_attr_layer2.attr, 714 &dev_attr_layer2.attr,
655 &dev_attr_isolation.attr, 715 &dev_attr_isolation.attr,
716 &dev_attr_hw_trap.attr,
656 NULL, 717 NULL,
657}; 718};
658 719
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 6fbaacb21943..b70b47fbd6cd 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -420,10 +420,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_card *card,
420 case QETH_HEADER_TYPE_LAYER2: 420 case QETH_HEADER_TYPE_LAYER2:
421 skb->pkt_type = PACKET_HOST; 421 skb->pkt_type = PACKET_HOST;
422 skb->protocol = eth_type_trans(skb, skb->dev); 422 skb->protocol = eth_type_trans(skb, skb->dev);
423 if (card->options.checksum_type == NO_CHECKSUMMING) 423 skb->ip_summed = CHECKSUM_NONE;
424 skb->ip_summed = CHECKSUM_UNNECESSARY;
425 else
426 skb->ip_summed = CHECKSUM_NONE;
427 if (skb->protocol == htons(ETH_P_802_2)) 424 if (skb->protocol == htons(ETH_P_802_2))
428 *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno; 425 *((__u32 *)skb->cb) = ++card->seqno.pkt_seqno;
429 len = skb->len; 426 len = skb->len;
@@ -879,6 +876,7 @@ static int qeth_l2_probe_device(struct ccwgroup_device *gdev)
879 INIT_LIST_HEAD(&card->vid_list); 876 INIT_LIST_HEAD(&card->vid_list);
880 INIT_LIST_HEAD(&card->mc_list); 877 INIT_LIST_HEAD(&card->mc_list);
881 card->options.layer2 = 1; 878 card->options.layer2 = 1;
879 card->info.hwtrap = 0;
882 card->discipline.start_poll = qeth_qdio_start_poll; 880 card->discipline.start_poll = qeth_qdio_start_poll;
883 card->discipline.input_handler = (qdio_handler_t *) 881 card->discipline.input_handler = (qdio_handler_t *)
884 qeth_qdio_input_handler; 882 qeth_qdio_input_handler;
@@ -997,6 +995,13 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
997 if (card->info.type != QETH_CARD_TYPE_OSN) 995 if (card->info.type != QETH_CARD_TYPE_OSN)
998 qeth_l2_send_setmac(card, &card->dev->dev_addr[0]); 996 qeth_l2_send_setmac(card, &card->dev->dev_addr[0]);
999 997
998 if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
999 if (card->info.hwtrap &&
1000 qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
1001 card->info.hwtrap = 0;
1002 } else
1003 card->info.hwtrap = 0;
1004
1000 card->state = CARD_STATE_HARDSETUP; 1005 card->state = CARD_STATE_HARDSETUP;
1001 memset(&card->rx, 0, sizeof(struct qeth_rx)); 1006 memset(&card->rx, 0, sizeof(struct qeth_rx));
1002 qeth_print_status_message(card); 1007 qeth_print_status_message(card);
@@ -1095,6 +1100,10 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
1095 if (card->dev && netif_carrier_ok(card->dev)) 1100 if (card->dev && netif_carrier_ok(card->dev))
1096 netif_carrier_off(card->dev); 1101 netif_carrier_off(card->dev);
1097 recover_flag = card->state; 1102 recover_flag = card->state;
1103 if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
1104 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
1105 card->info.hwtrap = 1;
1106 }
1098 qeth_l2_stop_card(card, recovery_mode); 1107 qeth_l2_stop_card(card, recovery_mode);
1099 rc = ccw_device_set_offline(CARD_DDEV(card)); 1108 rc = ccw_device_set_offline(CARD_DDEV(card));
1100 rc2 = ccw_device_set_offline(CARD_WDEV(card)); 1109 rc2 = ccw_device_set_offline(CARD_WDEV(card));
@@ -1160,6 +1169,8 @@ static void __exit qeth_l2_exit(void)
1160static void qeth_l2_shutdown(struct ccwgroup_device *gdev) 1169static void qeth_l2_shutdown(struct ccwgroup_device *gdev)
1161{ 1170{
1162 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 1171 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
1172 if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
1173 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
1163 qeth_qdio_clear_card(card, 0); 1174 qeth_qdio_clear_card(card, 0);
1164 qeth_clear_qdio_buffers(card); 1175 qeth_clear_qdio_buffers(card);
1165} 1176}
@@ -1175,6 +1186,8 @@ static int qeth_l2_pm_suspend(struct ccwgroup_device *gdev)
1175 if (gdev->state == CCWGROUP_OFFLINE) 1186 if (gdev->state == CCWGROUP_OFFLINE)
1176 return 0; 1187 return 0;
1177 if (card->state == CARD_STATE_UP) { 1188 if (card->state == CARD_STATE_UP) {
1189 if (card->info.hwtrap)
1190 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
1178 __qeth_l2_set_offline(card->gdev, 1); 1191 __qeth_l2_set_offline(card->gdev, 1);
1179 } else 1192 } else
1180 __qeth_l2_set_offline(card->gdev, 0); 1193 __qeth_l2_set_offline(card->gdev, 0);
diff --git a/drivers/s390/net/qeth_l3.h b/drivers/s390/net/qeth_l3.h
index e705b27ec7dc..14a43aeb0c2a 100644
--- a/drivers/s390/net/qeth_l3.h
+++ b/drivers/s390/net/qeth_l3.h
@@ -62,8 +62,6 @@ void qeth_l3_del_vipa(struct qeth_card *, enum qeth_prot_versions, const u8 *);
62int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *); 62int qeth_l3_add_rxip(struct qeth_card *, enum qeth_prot_versions, const u8 *);
63void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions, 63void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions,
64 const u8 *); 64 const u8 *);
65int qeth_l3_set_large_send(struct qeth_card *, enum qeth_large_send_types);
66int qeth_l3_set_rx_csum(struct qeth_card *, enum qeth_checksum_types);
67int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *); 65int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *, struct qeth_ipaddr *);
68 66
69#endif /* __QETH_L3_H__ */ 67#endif /* __QETH_L3_H__ */
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 142e5f6ef4f3..fd69da3fa6b4 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -43,33 +43,6 @@ static int qeth_l3_deregister_addr_entry(struct qeth_card *,
43static int __qeth_l3_set_online(struct ccwgroup_device *, int); 43static int __qeth_l3_set_online(struct ccwgroup_device *, int);
44static int __qeth_l3_set_offline(struct ccwgroup_device *, int); 44static int __qeth_l3_set_offline(struct ccwgroup_device *, int);
45 45
46int qeth_l3_set_large_send(struct qeth_card *card,
47 enum qeth_large_send_types type)
48{
49 int rc = 0;
50
51 card->options.large_send = type;
52 if (card->dev == NULL)
53 return 0;
54
55 if (card->options.large_send == QETH_LARGE_SEND_TSO) {
56 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)) {
57 card->dev->features |= NETIF_F_TSO | NETIF_F_SG |
58 NETIF_F_IP_CSUM;
59 } else {
60 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
61 NETIF_F_IP_CSUM);
62 card->options.large_send = QETH_LARGE_SEND_NO;
63 rc = -EOPNOTSUPP;
64 }
65 } else {
66 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG |
67 NETIF_F_IP_CSUM);
68 card->options.large_send = QETH_LARGE_SEND_NO;
69 }
70 return rc;
71}
72
73static int qeth_l3_isxdigit(char *buf) 46static int qeth_l3_isxdigit(char *buf)
74{ 47{
75 while (*buf) { 48 while (*buf) {
@@ -1304,39 +1277,6 @@ static int qeth_l3_start_ipa_multicast(struct qeth_card *card)
1304 return rc; 1277 return rc;
1305} 1278}
1306 1279
1307static int qeth_l3_query_ipassists_cb(struct qeth_card *card,
1308 struct qeth_reply *reply, unsigned long data)
1309{
1310 struct qeth_ipa_cmd *cmd;
1311
1312 QETH_DBF_TEXT(SETUP, 2, "qipasscb");
1313
1314 cmd = (struct qeth_ipa_cmd *) data;
1315 if (cmd->hdr.prot_version == QETH_PROT_IPV4) {
1316 card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported;
1317 card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled;
1318 } else {
1319 card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported;
1320 card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
1321 }
1322 QETH_DBF_TEXT(SETUP, 2, "suppenbl");
1323 QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_supported);
1324 QETH_DBF_TEXT_(SETUP, 2, "%x", cmd->hdr.ipa_enabled);
1325 return 0;
1326}
1327
1328static int qeth_l3_query_ipassists(struct qeth_card *card,
1329 enum qeth_prot_versions prot)
1330{
1331 int rc;
1332 struct qeth_cmd_buffer *iob;
1333
1334 QETH_DBF_TEXT_(SETUP, 2, "qipassi%i", prot);
1335 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_QIPASSIST, prot);
1336 rc = qeth_send_ipa_cmd(card, iob, qeth_l3_query_ipassists_cb, NULL);
1337 return rc;
1338}
1339
1340#ifdef CONFIG_QETH_IPV6 1280#ifdef CONFIG_QETH_IPV6
1341static int qeth_l3_softsetup_ipv6(struct qeth_card *card) 1281static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
1342{ 1282{
@@ -1347,7 +1287,7 @@ static int qeth_l3_softsetup_ipv6(struct qeth_card *card)
1347 if (card->info.type == QETH_CARD_TYPE_IQD) 1287 if (card->info.type == QETH_CARD_TYPE_IQD)
1348 goto out; 1288 goto out;
1349 1289
1350 rc = qeth_l3_query_ipassists(card, QETH_PROT_IPV6); 1290 rc = qeth_query_ipassists(card, QETH_PROT_IPV6);
1351 if (rc) { 1291 if (rc) {
1352 dev_err(&card->gdev->dev, 1292 dev_err(&card->gdev->dev,
1353 "Activating IPv6 support for %s failed\n", 1293 "Activating IPv6 support for %s failed\n",
@@ -1472,68 +1412,38 @@ static int qeth_l3_send_checksum_command(struct qeth_card *card)
1472 return 0; 1412 return 0;
1473} 1413}
1474 1414
1475int qeth_l3_set_rx_csum(struct qeth_card *card, 1415int qeth_l3_set_rx_csum(struct qeth_card *card, int on)
1476 enum qeth_checksum_types csum_type)
1477{ 1416{
1478 int rc = 0; 1417 int rc = 0;
1479 1418
1480 if (card->options.checksum_type == HW_CHECKSUMMING) { 1419 if (on) {
1481 if ((csum_type != HW_CHECKSUMMING) && 1420 rc = qeth_l3_send_checksum_command(card);
1482 (card->state != CARD_STATE_DOWN)) { 1421 if (rc)
1483 rc = qeth_l3_send_simple_setassparms(card, 1422 return -EIO;
1484 IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0); 1423 dev_info(&card->gdev->dev,
1485 if (rc) 1424 "HW Checksumming (inbound) enabled\n");
1486 return -EIO;
1487 }
1488 } else { 1425 } else {
1489 if (csum_type == HW_CHECKSUMMING) { 1426 rc = qeth_l3_send_simple_setassparms(card,
1490 if (card->state != CARD_STATE_DOWN) { 1427 IPA_INBOUND_CHECKSUM, IPA_CMD_ASS_STOP, 0);
1491 if (!qeth_is_supported(card, 1428 if (rc)
1492 IPA_INBOUND_CHECKSUM)) 1429 return -EIO;
1493 return -EPERM;
1494 rc = qeth_l3_send_checksum_command(card);
1495 if (rc)
1496 return -EIO;
1497 }
1498 }
1499 } 1430 }
1500 card->options.checksum_type = csum_type; 1431
1501 return rc; 1432 return 0;
1502} 1433}
1503 1434
1504static int qeth_l3_start_ipa_checksum(struct qeth_card *card) 1435static int qeth_l3_start_ipa_checksum(struct qeth_card *card)
1505{ 1436{
1506 int rc = 0;
1507
1508 QETH_CARD_TEXT(card, 3, "strtcsum"); 1437 QETH_CARD_TEXT(card, 3, "strtcsum");
1509 1438
1510 if (card->options.checksum_type == NO_CHECKSUMMING) { 1439 if (card->dev->features & NETIF_F_RXCSUM) {
1511 dev_info(&card->gdev->dev, 1440 rtnl_lock();
1512 "Using no checksumming on %s.\n", 1441 /* force set_features call */
1513 QETH_CARD_IFNAME(card)); 1442 card->dev->features &= ~NETIF_F_RXCSUM;
1514 return 0; 1443 netdev_update_features(card->dev);
1515 } 1444 rtnl_unlock();
1516 if (card->options.checksum_type == SW_CHECKSUMMING) {
1517 dev_info(&card->gdev->dev,
1518 "Using SW checksumming on %s.\n",
1519 QETH_CARD_IFNAME(card));
1520 return 0;
1521 }
1522 if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) {
1523 dev_info(&card->gdev->dev,
1524 "Inbound HW Checksumming not "
1525 "supported on %s,\ncontinuing "
1526 "using Inbound SW Checksumming\n",
1527 QETH_CARD_IFNAME(card));
1528 card->options.checksum_type = SW_CHECKSUMMING;
1529 return 0;
1530 } 1445 }
1531 rc = qeth_l3_send_checksum_command(card); 1446 return 0;
1532 if (!rc)
1533 dev_info(&card->gdev->dev,
1534 "HW Checksumming (inbound) enabled\n");
1535
1536 return rc;
1537} 1447}
1538 1448
1539static int qeth_l3_start_ipa_tx_checksum(struct qeth_card *card) 1449static int qeth_l3_start_ipa_tx_checksum(struct qeth_card *card)
@@ -1580,10 +1490,8 @@ static int qeth_l3_start_ipa_tso(struct qeth_card *card)
1580 dev_info(&card->gdev->dev, 1490 dev_info(&card->gdev->dev,
1581 "Outbound TSO enabled\n"); 1491 "Outbound TSO enabled\n");
1582 } 1492 }
1583 if (rc && (card->options.large_send == QETH_LARGE_SEND_TSO)) { 1493 if (rc)
1584 card->options.large_send = QETH_LARGE_SEND_NO; 1494 card->dev->features &= ~NETIF_F_TSO;
1585 card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG);
1586 }
1587 return rc; 1495 return rc;
1588} 1496}
1589 1497
@@ -2064,14 +1972,7 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
2064 is_vlan = 1; 1972 is_vlan = 1;
2065 } 1973 }
2066 1974
2067 switch (card->options.checksum_type) { 1975 if (card->dev->features & NETIF_F_RXCSUM) {
2068 case SW_CHECKSUMMING:
2069 skb->ip_summed = CHECKSUM_NONE;
2070 break;
2071 case NO_CHECKSUMMING:
2072 skb->ip_summed = CHECKSUM_UNNECESSARY;
2073 break;
2074 case HW_CHECKSUMMING:
2075 if ((hdr->hdr.l3.ext_flags & 1976 if ((hdr->hdr.l3.ext_flags &
2076 (QETH_HDR_EXT_CSUM_HDR_REQ | 1977 (QETH_HDR_EXT_CSUM_HDR_REQ |
2077 QETH_HDR_EXT_CSUM_TRANSP_REQ)) == 1978 QETH_HDR_EXT_CSUM_TRANSP_REQ)) ==
@@ -2080,7 +1981,8 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card,
2080 skb->ip_summed = CHECKSUM_UNNECESSARY; 1981 skb->ip_summed = CHECKSUM_UNNECESSARY;
2081 else 1982 else
2082 skb->ip_summed = CHECKSUM_NONE; 1983 skb->ip_summed = CHECKSUM_NONE;
2083 } 1984 } else
1985 skb->ip_summed = CHECKSUM_NONE;
2084 1986
2085 return is_vlan; 1987 return is_vlan;
2086} 1988}
@@ -3024,7 +2926,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3024 struct qeth_qdio_out_q *queue = card->qdio.out_qs 2926 struct qeth_qdio_out_q *queue = card->qdio.out_qs
3025 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; 2927 [qeth_get_priority_queue(card, skb, ipv, cast_type)];
3026 int tx_bytes = skb->len; 2928 int tx_bytes = skb->len;
3027 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 2929 bool large_send;
3028 int data_offset = -1; 2930 int data_offset = -1;
3029 int nr_frags; 2931 int nr_frags;
3030 2932
@@ -3046,8 +2948,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3046 card->perf_stats.outbound_start_time = qeth_get_micros(); 2948 card->perf_stats.outbound_start_time = qeth_get_micros();
3047 } 2949 }
3048 2950
3049 if (skb_is_gso(skb)) 2951 large_send = skb_is_gso(skb);
3050 large_send = card->options.large_send;
3051 2952
3052 if ((card->info.type == QETH_CARD_TYPE_IQD) && (!large_send) && 2953 if ((card->info.type == QETH_CARD_TYPE_IQD) && (!large_send) &&
3053 (skb_shinfo(skb)->nr_frags == 0)) { 2954 (skb_shinfo(skb)->nr_frags == 0)) {
@@ -3096,7 +2997,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3096 /* fix hardware limitation: as long as we do not have sbal 2997 /* fix hardware limitation: as long as we do not have sbal
3097 * chaining we can not send long frag lists 2998 * chaining we can not send long frag lists
3098 */ 2999 */
3099 if (large_send == QETH_LARGE_SEND_TSO) { 3000 if (large_send) {
3100 if (qeth_l3_tso_elements(new_skb) + 1 > 16) { 3001 if (qeth_l3_tso_elements(new_skb) + 1 > 16) {
3101 if (skb_linearize(new_skb)) 3002 if (skb_linearize(new_skb))
3102 goto tx_drop; 3003 goto tx_drop;
@@ -3105,8 +3006,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3105 } 3006 }
3106 } 3007 }
3107 3008
3108 if ((large_send == QETH_LARGE_SEND_TSO) && 3009 if (large_send && (cast_type == RTN_UNSPEC)) {
3109 (cast_type == RTN_UNSPEC)) {
3110 hdr = (struct qeth_hdr *)skb_push(new_skb, 3010 hdr = (struct qeth_hdr *)skb_push(new_skb,
3111 sizeof(struct qeth_hdr_tso)); 3011 sizeof(struct qeth_hdr_tso));
3112 memset(hdr, 0, sizeof(struct qeth_hdr_tso)); 3012 memset(hdr, 0, sizeof(struct qeth_hdr_tso));
@@ -3141,7 +3041,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3141 3041
3142 if (card->info.type != QETH_CARD_TYPE_IQD) { 3042 if (card->info.type != QETH_CARD_TYPE_IQD) {
3143 int len; 3043 int len;
3144 if (large_send == QETH_LARGE_SEND_TSO) 3044 if (large_send)
3145 len = ((unsigned long)tcp_hdr(new_skb) + 3045 len = ((unsigned long)tcp_hdr(new_skb) +
3146 tcp_hdr(new_skb)->doff * 4) - 3046 tcp_hdr(new_skb)->doff * 4) -
3147 (unsigned long)new_skb->data; 3047 (unsigned long)new_skb->data;
@@ -3162,7 +3062,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
3162 if (new_skb != skb) 3062 if (new_skb != skb)
3163 dev_kfree_skb_any(skb); 3063 dev_kfree_skb_any(skb);
3164 if (card->options.performance_stats) { 3064 if (card->options.performance_stats) {
3165 if (large_send != QETH_LARGE_SEND_NO) { 3065 if (large_send) {
3166 card->perf_stats.large_send_bytes += tx_bytes; 3066 card->perf_stats.large_send_bytes += tx_bytes;
3167 card->perf_stats.large_send_cnt++; 3067 card->perf_stats.large_send_cnt++;
3168 } 3068 }
@@ -3248,65 +3148,42 @@ static int qeth_l3_stop(struct net_device *dev)
3248 return 0; 3148 return 0;
3249} 3149}
3250 3150
3251static u32 qeth_l3_ethtool_get_rx_csum(struct net_device *dev) 3151static u32 qeth_l3_fix_features(struct net_device *dev, u32 features)
3252{ 3152{
3253 struct qeth_card *card = dev->ml_priv; 3153 struct qeth_card *card = dev->ml_priv;
3254 3154
3255 return (card->options.checksum_type == HW_CHECKSUMMING); 3155 if (!qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM))
3256} 3156 features &= ~NETIF_F_IP_CSUM;
3257 3157 if (!qeth_is_supported(card, IPA_OUTBOUND_TSO))
3258static int qeth_l3_ethtool_set_rx_csum(struct net_device *dev, u32 data) 3158 features &= ~NETIF_F_TSO;
3259{ 3159 if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM))
3260 struct qeth_card *card = dev->ml_priv; 3160 features &= ~NETIF_F_RXCSUM;
3261 enum qeth_checksum_types csum_type;
3262
3263 if (data)
3264 csum_type = HW_CHECKSUMMING;
3265 else
3266 csum_type = SW_CHECKSUMMING;
3267 3161
3268 return qeth_l3_set_rx_csum(card, csum_type); 3162 return features;
3269} 3163}
3270 3164
3271static int qeth_l3_ethtool_set_tso(struct net_device *dev, u32 data) 3165static int qeth_l3_set_features(struct net_device *dev, u32 features)
3272{ 3166{
3273 struct qeth_card *card = dev->ml_priv; 3167 struct qeth_card *card = dev->ml_priv;
3274 int rc = 0; 3168 u32 changed = dev->features ^ features;
3169 int err;
3275 3170
3276 if (data) { 3171 if (!(changed & NETIF_F_RXCSUM))
3277 rc = qeth_l3_set_large_send(card, QETH_LARGE_SEND_TSO); 3172 return 0;
3278 } else {
3279 dev->features &= ~NETIF_F_TSO;
3280 card->options.large_send = QETH_LARGE_SEND_NO;
3281 }
3282 return rc;
3283}
3284 3173
3285static int qeth_l3_ethtool_set_tx_csum(struct net_device *dev, u32 data) 3174 if (card->state == CARD_STATE_DOWN ||
3286{ 3175 card->state == CARD_STATE_RECOVER)
3287 struct qeth_card *card = dev->ml_priv; 3176 return 0;
3288 3177
3289 if (data) { 3178 err = qeth_l3_set_rx_csum(card, features & NETIF_F_RXCSUM);
3290 if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) 3179 if (err)
3291 dev->features |= NETIF_F_IP_CSUM; 3180 dev->features = features ^ NETIF_F_RXCSUM;
3292 else
3293 return -EPERM;
3294 } else
3295 dev->features &= ~NETIF_F_IP_CSUM;
3296 3181
3297 return 0; 3182 return err;
3298} 3183}
3299 3184
3300static const struct ethtool_ops qeth_l3_ethtool_ops = { 3185static const struct ethtool_ops qeth_l3_ethtool_ops = {
3301 .get_link = ethtool_op_get_link, 3186 .get_link = ethtool_op_get_link,
3302 .get_tx_csum = ethtool_op_get_tx_csum,
3303 .set_tx_csum = qeth_l3_ethtool_set_tx_csum,
3304 .get_rx_csum = qeth_l3_ethtool_get_rx_csum,
3305 .set_rx_csum = qeth_l3_ethtool_set_rx_csum,
3306 .get_sg = ethtool_op_get_sg,
3307 .set_sg = ethtool_op_set_sg,
3308 .get_tso = ethtool_op_get_tso,
3309 .set_tso = qeth_l3_ethtool_set_tso,
3310 .get_strings = qeth_core_get_strings, 3187 .get_strings = qeth_core_get_strings,
3311 .get_ethtool_stats = qeth_core_get_ethtool_stats, 3188 .get_ethtool_stats = qeth_core_get_ethtool_stats,
3312 .get_sset_count = qeth_core_get_sset_count, 3189 .get_sset_count = qeth_core_get_sset_count,
@@ -3347,6 +3224,8 @@ static const struct net_device_ops qeth_l3_netdev_ops = {
3347 .ndo_set_multicast_list = qeth_l3_set_multicast_list, 3224 .ndo_set_multicast_list = qeth_l3_set_multicast_list,
3348 .ndo_do_ioctl = qeth_l3_do_ioctl, 3225 .ndo_do_ioctl = qeth_l3_do_ioctl,
3349 .ndo_change_mtu = qeth_change_mtu, 3226 .ndo_change_mtu = qeth_change_mtu,
3227 .ndo_fix_features = qeth_l3_fix_features,
3228 .ndo_set_features = qeth_l3_set_features,
3350 .ndo_vlan_rx_register = qeth_l3_vlan_rx_register, 3229 .ndo_vlan_rx_register = qeth_l3_vlan_rx_register,
3351 .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid, 3230 .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid,
3352 .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid, 3231 .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid,
@@ -3362,6 +3241,8 @@ static const struct net_device_ops qeth_l3_osa_netdev_ops = {
3362 .ndo_set_multicast_list = qeth_l3_set_multicast_list, 3241 .ndo_set_multicast_list = qeth_l3_set_multicast_list,
3363 .ndo_do_ioctl = qeth_l3_do_ioctl, 3242 .ndo_do_ioctl = qeth_l3_do_ioctl,
3364 .ndo_change_mtu = qeth_change_mtu, 3243 .ndo_change_mtu = qeth_change_mtu,
3244 .ndo_fix_features = qeth_l3_fix_features,
3245 .ndo_set_features = qeth_l3_set_features,
3365 .ndo_vlan_rx_register = qeth_l3_vlan_rx_register, 3246 .ndo_vlan_rx_register = qeth_l3_vlan_rx_register,
3366 .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid, 3247 .ndo_vlan_rx_add_vid = qeth_l3_vlan_rx_add_vid,
3367 .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid, 3248 .ndo_vlan_rx_kill_vid = qeth_l3_vlan_rx_kill_vid,
@@ -3392,8 +3273,12 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
3392 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) 3273 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
3393 card->dev->dev_id = card->info.unique_id & 3274 card->dev->dev_id = card->info.unique_id &
3394 0xffff; 3275 0xffff;
3395 if (!card->info.guestlan) 3276 if (!card->info.guestlan) {
3396 card->dev->features |= NETIF_F_GRO; 3277 card->dev->hw_features = NETIF_F_SG |
3278 NETIF_F_RXCSUM | NETIF_F_IP_CSUM |
3279 NETIF_F_TSO;
3280 card->dev->features = NETIF_F_RXCSUM;
3281 }
3397 } 3282 }
3398 } else if (card->info.type == QETH_CARD_TYPE_IQD) { 3283 } else if (card->info.type == QETH_CARD_TYPE_IQD) {
3399 card->dev = alloc_netdev(0, "hsi%d", ether_setup); 3284 card->dev = alloc_netdev(0, "hsi%d", ether_setup);
@@ -3426,15 +3311,13 @@ static int qeth_l3_probe_device(struct ccwgroup_device *gdev)
3426 3311
3427 qeth_l3_create_device_attributes(&gdev->dev); 3312 qeth_l3_create_device_attributes(&gdev->dev);
3428 card->options.layer2 = 0; 3313 card->options.layer2 = 0;
3314 card->info.hwtrap = 0;
3429 card->discipline.start_poll = qeth_qdio_start_poll; 3315 card->discipline.start_poll = qeth_qdio_start_poll;
3430 card->discipline.input_handler = (qdio_handler_t *) 3316 card->discipline.input_handler = (qdio_handler_t *)
3431 qeth_qdio_input_handler; 3317 qeth_qdio_input_handler;
3432 card->discipline.output_handler = (qdio_handler_t *) 3318 card->discipline.output_handler = (qdio_handler_t *)
3433 qeth_qdio_output_handler; 3319 qeth_qdio_output_handler;
3434 card->discipline.recover = qeth_l3_recover; 3320 card->discipline.recover = qeth_l3_recover;
3435 if ((card->info.type == QETH_CARD_TYPE_OSD) ||
3436 (card->info.type == QETH_CARD_TYPE_OSX))
3437 card->options.checksum_type = HW_CHECKSUMMING;
3438 return 0; 3321 return 0;
3439} 3322}
3440 3323
@@ -3480,13 +3363,18 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
3480 goto out_remove; 3363 goto out_remove;
3481 } 3364 }
3482 3365
3483 qeth_l3_query_ipassists(card, QETH_PROT_IPV4);
3484
3485 if (!card->dev && qeth_l3_setup_netdev(card)) { 3366 if (!card->dev && qeth_l3_setup_netdev(card)) {
3486 rc = -ENODEV; 3367 rc = -ENODEV;
3487 goto out_remove; 3368 goto out_remove;
3488 } 3369 }
3489 3370
3371 if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) {
3372 if (card->info.hwtrap &&
3373 qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM))
3374 card->info.hwtrap = 0;
3375 } else
3376 card->info.hwtrap = 0;
3377
3490 card->state = CARD_STATE_HARDSETUP; 3378 card->state = CARD_STATE_HARDSETUP;
3491 memset(&card->rx, 0, sizeof(struct qeth_rx)); 3379 memset(&card->rx, 0, sizeof(struct qeth_rx));
3492 qeth_print_status_message(card); 3380 qeth_print_status_message(card);
@@ -3516,7 +3404,6 @@ contin:
3516 rc = qeth_l3_start_ipassists(card); 3404 rc = qeth_l3_start_ipassists(card);
3517 if (rc) 3405 if (rc)
3518 QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc); 3406 QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
3519 qeth_l3_set_large_send(card, card->options.large_send);
3520 rc = qeth_l3_setrouting_v4(card); 3407 rc = qeth_l3_setrouting_v4(card);
3521 if (rc) 3408 if (rc)
3522 QETH_DBF_TEXT_(SETUP, 2, "4err%d", rc); 3409 QETH_DBF_TEXT_(SETUP, 2, "4err%d", rc);
@@ -3589,6 +3476,10 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev,
3589 if (card->dev && netif_carrier_ok(card->dev)) 3476 if (card->dev && netif_carrier_ok(card->dev))
3590 netif_carrier_off(card->dev); 3477 netif_carrier_off(card->dev);
3591 recover_flag = card->state; 3478 recover_flag = card->state;
3479 if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) {
3480 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
3481 card->info.hwtrap = 1;
3482 }
3592 qeth_l3_stop_card(card, recovery_mode); 3483 qeth_l3_stop_card(card, recovery_mode);
3593 rc = ccw_device_set_offline(CARD_DDEV(card)); 3484 rc = ccw_device_set_offline(CARD_DDEV(card));
3594 rc2 = ccw_device_set_offline(CARD_WDEV(card)); 3485 rc2 = ccw_device_set_offline(CARD_WDEV(card));
@@ -3644,6 +3535,8 @@ static int qeth_l3_recover(void *ptr)
3644static void qeth_l3_shutdown(struct ccwgroup_device *gdev) 3535static void qeth_l3_shutdown(struct ccwgroup_device *gdev)
3645{ 3536{
3646 struct qeth_card *card = dev_get_drvdata(&gdev->dev); 3537 struct qeth_card *card = dev_get_drvdata(&gdev->dev);
3538 if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap)
3539 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
3647 qeth_qdio_clear_card(card, 0); 3540 qeth_qdio_clear_card(card, 0);
3648 qeth_clear_qdio_buffers(card); 3541 qeth_clear_qdio_buffers(card);
3649} 3542}
@@ -3659,6 +3552,8 @@ static int qeth_l3_pm_suspend(struct ccwgroup_device *gdev)
3659 if (gdev->state == CCWGROUP_OFFLINE) 3552 if (gdev->state == CCWGROUP_OFFLINE)
3660 return 0; 3553 return 0;
3661 if (card->state == CARD_STATE_UP) { 3554 if (card->state == CARD_STATE_UP) {
3555 if (card->info.hwtrap)
3556 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM);
3662 __qeth_l3_set_offline(card->gdev, 1); 3557 __qeth_l3_set_offline(card->gdev, 1);
3663 } else 3558 } else
3664 __qeth_l3_set_offline(card->gdev, 0); 3559 __qeth_l3_set_offline(card->gdev, 0);
diff --git a/drivers/s390/net/qeth_l3_sys.c b/drivers/s390/net/qeth_l3_sys.c
index 67cfa68dcf1b..cd99210296e2 100644
--- a/drivers/s390/net/qeth_l3_sys.c
+++ b/drivers/s390/net/qeth_l3_sys.c
@@ -15,16 +15,6 @@
15#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \ 15#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \
16struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store) 16struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)
17 17
18static const char *qeth_l3_get_checksum_str(struct qeth_card *card)
19{
20 if (card->options.checksum_type == SW_CHECKSUMMING)
21 return "sw";
22 else if (card->options.checksum_type == HW_CHECKSUMMING)
23 return "hw";
24 else
25 return "no";
26}
27
28static ssize_t qeth_l3_dev_route_show(struct qeth_card *card, 18static ssize_t qeth_l3_dev_route_show(struct qeth_card *card,
29 struct qeth_routing_info *route, char *buf) 19 struct qeth_routing_info *route, char *buf)
30{ 20{
@@ -295,51 +285,6 @@ out:
295static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show, 285static DEVICE_ATTR(canonical_macaddr, 0644, qeth_l3_dev_canonical_macaddr_show,
296 qeth_l3_dev_canonical_macaddr_store); 286 qeth_l3_dev_canonical_macaddr_store);
297 287
298static ssize_t qeth_l3_dev_checksum_show(struct device *dev,
299 struct device_attribute *attr, char *buf)
300{
301 struct qeth_card *card = dev_get_drvdata(dev);
302
303 if (!card)
304 return -EINVAL;
305
306 return sprintf(buf, "%s checksumming\n",
307 qeth_l3_get_checksum_str(card));
308}
309
310static ssize_t qeth_l3_dev_checksum_store(struct device *dev,
311 struct device_attribute *attr, const char *buf, size_t count)
312{
313 struct qeth_card *card = dev_get_drvdata(dev);
314 enum qeth_checksum_types csum_type;
315 char *tmp;
316 int rc = 0;
317
318 if (!card)
319 return -EINVAL;
320
321 mutex_lock(&card->conf_mutex);
322 tmp = strsep((char **) &buf, "\n");
323 if (!strcmp(tmp, "sw_checksumming"))
324 csum_type = SW_CHECKSUMMING;
325 else if (!strcmp(tmp, "hw_checksumming"))
326 csum_type = HW_CHECKSUMMING;
327 else if (!strcmp(tmp, "no_checksumming"))
328 csum_type = NO_CHECKSUMMING;
329 else {
330 rc = -EINVAL;
331 goto out;
332 }
333
334 rc = qeth_l3_set_rx_csum(card, csum_type);
335out:
336 mutex_unlock(&card->conf_mutex);
337 return rc ? rc : count;
338}
339
340static DEVICE_ATTR(checksumming, 0644, qeth_l3_dev_checksum_show,
341 qeth_l3_dev_checksum_store);
342
343static ssize_t qeth_l3_dev_sniffer_show(struct device *dev, 288static ssize_t qeth_l3_dev_sniffer_show(struct device *dev,
344 struct device_attribute *attr, char *buf) 289 struct device_attribute *attr, char *buf)
345{ 290{
@@ -402,61 +347,13 @@ out:
402static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show, 347static DEVICE_ATTR(sniffer, 0644, qeth_l3_dev_sniffer_show,
403 qeth_l3_dev_sniffer_store); 348 qeth_l3_dev_sniffer_store);
404 349
405static ssize_t qeth_l3_dev_large_send_show(struct device *dev,
406 struct device_attribute *attr, char *buf)
407{
408 struct qeth_card *card = dev_get_drvdata(dev);
409
410 if (!card)
411 return -EINVAL;
412
413 switch (card->options.large_send) {
414 case QETH_LARGE_SEND_NO:
415 return sprintf(buf, "%s\n", "no");
416 case QETH_LARGE_SEND_TSO:
417 return sprintf(buf, "%s\n", "TSO");
418 default:
419 return sprintf(buf, "%s\n", "N/A");
420 }
421}
422
423static ssize_t qeth_l3_dev_large_send_store(struct device *dev,
424 struct device_attribute *attr, const char *buf, size_t count)
425{
426 struct qeth_card *card = dev_get_drvdata(dev);
427 enum qeth_large_send_types type;
428 int rc = 0;
429 char *tmp;
430
431 if (!card)
432 return -EINVAL;
433 tmp = strsep((char **) &buf, "\n");
434 if (!strcmp(tmp, "no"))
435 type = QETH_LARGE_SEND_NO;
436 else if (!strcmp(tmp, "TSO"))
437 type = QETH_LARGE_SEND_TSO;
438 else
439 return -EINVAL;
440
441 mutex_lock(&card->conf_mutex);
442 if (card->options.large_send != type)
443 rc = qeth_l3_set_large_send(card, type);
444 mutex_unlock(&card->conf_mutex);
445 return rc ? rc : count;
446}
447
448static DEVICE_ATTR(large_send, 0644, qeth_l3_dev_large_send_show,
449 qeth_l3_dev_large_send_store);
450
451static struct attribute *qeth_l3_device_attrs[] = { 350static struct attribute *qeth_l3_device_attrs[] = {
452 &dev_attr_route4.attr, 351 &dev_attr_route4.attr,
453 &dev_attr_route6.attr, 352 &dev_attr_route6.attr,
454 &dev_attr_fake_broadcast.attr, 353 &dev_attr_fake_broadcast.attr,
455 &dev_attr_broadcast_mode.attr, 354 &dev_attr_broadcast_mode.attr,
456 &dev_attr_canonical_macaddr.attr, 355 &dev_attr_canonical_macaddr.attr,
457 &dev_attr_checksumming.attr,
458 &dev_attr_sniffer.attr, 356 &dev_attr_sniffer.attr,
459 &dev_attr_large_send.attr,
460 NULL, 357 NULL,
461}; 358};
462 359