aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 13:37:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 13:37:28 -0400
commitd7e9660ad9d5e0845f52848bce31bcf5cdcdea6b (patch)
treec6c67d145771187b194d79d603742b31090a59d6 /drivers/s390
parentb8cb48aae1b8c50b37dcb7710363aa69a7a0d9ca (diff)
parent13af7a6ea502fcdd4c0e3d7de6e332b102309491 (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: (1623 commits) netxen: update copyright netxen: fix tx timeout recovery netxen: fix file firmware leak netxen: improve pci memory access netxen: change firmware write size tg3: Fix return ring size breakage netxen: build fix for INET=n cdc-phonet: autoconfigure Phonet address Phonet: back-end for autoconfigured addresses Phonet: fix netlink address dump error handling ipv6: Add IFA_F_DADFAILED flag net: Add DEVTYPE support for Ethernet based devices mv643xx_eth.c: remove unused txq_set_wrr() ucc_geth: Fix hangs after switching from full to half duplex ucc_geth: Rearrange some code to avoid forward declarations phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs drivers/net/phy: introduce missing kfree drivers/net/wan: introduce missing kfree net: force bridge module(s) to be GPL Subject: [PATCH] appletalk: Fix skb leak when ipddp interface is not loaded ... Fixed up trivial conflicts: - arch/x86/include/asm/socket.h converted to <asm-generic/socket.h> in the x86 tree. The generic header has the same new #define's, so that works out fine. - drivers/net/tun.c fix conflict between 89f56d1e9 ("tun: reuse struct sock fields") that switched over to using 'tun->socket.sk' instead of the redundantly available (and thus removed) 'tun->sk', and 2b980dbd ("lsm: Add hooks to the TUN driver") which added a new 'tun->sk' use. Noted in 'next' by Stephen Rothwell.
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/claw.c2
-rw-r--r--drivers/s390/net/ctcm_main.c11
-rw-r--r--drivers/s390/net/lcs.c8
-rw-r--r--drivers/s390/net/netiucv.c7
-rw-r--r--drivers/s390/net/qeth_core.h10
-rw-r--r--drivers/s390/net/qeth_core_main.c114
-rw-r--r--drivers/s390/net/qeth_core_sys.c2
-rw-r--r--drivers/s390/net/qeth_l2_main.c48
-rw-r--r--drivers/s390/net/qeth_l3_main.c52
9 files changed, 142 insertions, 112 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index f370f8d460a7..c63babefb698 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -350,6 +350,8 @@ claw_tx(struct sk_buff *skb, struct net_device *dev)
350 CLAW_DBF_TEXT_(4, trace, "clawtx%d", rc); 350 CLAW_DBF_TEXT_(4, trace, "clawtx%d", rc);
351 if (rc) 351 if (rc)
352 rc = NETDEV_TX_BUSY; 352 rc = NETDEV_TX_BUSY;
353 else
354 rc = NETDEV_TX_OK;
353 return rc; 355 return rc;
354} /* end of claw_tx */ 356} /* end of claw_tx */
355 357
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 222e47394437..c5b83874500c 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -164,7 +164,6 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
164 priv->stats.rx_packets++; 164 priv->stats.rx_packets++;
165 priv->stats.rx_bytes += skblen; 165 priv->stats.rx_bytes += skblen;
166 netif_rx_ni(skb); 166 netif_rx_ni(skb);
167 dev->last_rx = jiffies;
168 if (len > 0) { 167 if (len > 0) {
169 skb_pull(pskb, header->length); 168 skb_pull(pskb, header->length);
170 if (skb_tailroom(pskb) < LL_HEADER_LENGTH) { 169 if (skb_tailroom(pskb) < LL_HEADER_LENGTH) {
@@ -880,7 +879,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
880 "%s(%s): NULL sk_buff passed", 879 "%s(%s): NULL sk_buff passed",
881 CTCM_FUNTAIL, dev->name); 880 CTCM_FUNTAIL, dev->name);
882 priv->stats.tx_dropped++; 881 priv->stats.tx_dropped++;
883 return 0; 882 return NETDEV_TX_OK;
884 } 883 }
885 if (skb_headroom(skb) < (LL_HEADER_LENGTH + 2)) { 884 if (skb_headroom(skb) < (LL_HEADER_LENGTH + 2)) {
886 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR, 885 CTCM_DBF_TEXT_(ERROR, CTC_DBF_ERROR,
@@ -888,7 +887,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
888 CTCM_FUNTAIL, dev->name, LL_HEADER_LENGTH + 2); 887 CTCM_FUNTAIL, dev->name, LL_HEADER_LENGTH + 2);
889 dev_kfree_skb(skb); 888 dev_kfree_skb(skb);
890 priv->stats.tx_dropped++; 889 priv->stats.tx_dropped++;
891 return 0; 890 return NETDEV_TX_OK;
892 } 891 }
893 892
894 /* 893 /*
@@ -901,7 +900,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
901 priv->stats.tx_dropped++; 900 priv->stats.tx_dropped++;
902 priv->stats.tx_errors++; 901 priv->stats.tx_errors++;
903 priv->stats.tx_carrier_errors++; 902 priv->stats.tx_carrier_errors++;
904 return 0; 903 return NETDEV_TX_OK;
905 } 904 }
906 905
907 if (ctcm_test_and_set_busy(dev)) 906 if (ctcm_test_and_set_busy(dev))
@@ -910,7 +909,7 @@ static int ctcm_tx(struct sk_buff *skb, struct net_device *dev)
910 dev->trans_start = jiffies; 909 dev->trans_start = jiffies;
911 if (ctcm_transmit_skb(priv->channel[WRITE], skb) != 0) 910 if (ctcm_transmit_skb(priv->channel[WRITE], skb) != 0)
912 return NETDEV_TX_BUSY; 911 return NETDEV_TX_BUSY;
913 return 0; 912 return NETDEV_TX_OK;
914} 913}
915 914
916/* unmerged MPC variant of ctcm_tx */ 915/* unmerged MPC variant of ctcm_tx */
@@ -1008,7 +1007,7 @@ done:
1008 if (do_debug) 1007 if (do_debug)
1009 MPC_DBF_DEV_NAME(TRACE, dev, "exit"); 1008 MPC_DBF_DEV_NAME(TRACE, dev, "exit");
1010 1009
1011 return 0; /* handle freeing of skb here */ 1010 return NETDEV_TX_OK; /* handle freeing of skb here */
1012} 1011}
1013 1012
1014 1013
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 8c675905448b..a70de9b4bf29 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1553,24 +1553,24 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb,
1553 struct net_device *dev) 1553 struct net_device *dev)
1554{ 1554{
1555 struct lcs_header *header; 1555 struct lcs_header *header;
1556 int rc = 0; 1556 int rc = NETDEV_TX_OK;
1557 1557
1558 LCS_DBF_TEXT(5, trace, "hardxmit"); 1558 LCS_DBF_TEXT(5, trace, "hardxmit");
1559 if (skb == NULL) { 1559 if (skb == NULL) {
1560 card->stats.tx_dropped++; 1560 card->stats.tx_dropped++;
1561 card->stats.tx_errors++; 1561 card->stats.tx_errors++;
1562 return 0; 1562 return NETDEV_TX_OK;
1563 } 1563 }
1564 if (card->state != DEV_STATE_UP) { 1564 if (card->state != DEV_STATE_UP) {
1565 dev_kfree_skb(skb); 1565 dev_kfree_skb(skb);
1566 card->stats.tx_dropped++; 1566 card->stats.tx_dropped++;
1567 card->stats.tx_errors++; 1567 card->stats.tx_errors++;
1568 card->stats.tx_carrier_errors++; 1568 card->stats.tx_carrier_errors++;
1569 return 0; 1569 return NETDEV_TX_OK;
1570 } 1570 }
1571 if (skb->protocol == htons(ETH_P_IPV6)) { 1571 if (skb->protocol == htons(ETH_P_IPV6)) {
1572 dev_kfree_skb(skb); 1572 dev_kfree_skb(skb);
1573 return 0; 1573 return NETDEV_TX_OK;
1574 } 1574 }
1575 netif_stop_queue(card->dev); 1575 netif_stop_queue(card->dev);
1576 spin_lock(&card->lock); 1576 spin_lock(&card->lock);
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 87dff11061b0..9215fbbccc08 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -676,7 +676,6 @@ static void netiucv_unpack_skb(struct iucv_connection *conn,
676 * we must use netif_rx_ni() instead of netif_rx() 676 * we must use netif_rx_ni() instead of netif_rx()
677 */ 677 */
678 netif_rx_ni(skb); 678 netif_rx_ni(skb);
679 dev->last_rx = jiffies;
680 skb_pull(pskb, header->next); 679 skb_pull(pskb, header->next);
681 skb_put(pskb, NETIUCV_HDRLEN); 680 skb_put(pskb, NETIUCV_HDRLEN);
682 } 681 }
@@ -1376,14 +1375,14 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
1376 if (skb == NULL) { 1375 if (skb == NULL) {
1377 IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n"); 1376 IUCV_DBF_TEXT(data, 2, "netiucv_tx: skb is NULL\n");
1378 privptr->stats.tx_dropped++; 1377 privptr->stats.tx_dropped++;
1379 return 0; 1378 return NETDEV_TX_OK;
1380 } 1379 }
1381 if (skb_headroom(skb) < NETIUCV_HDRLEN) { 1380 if (skb_headroom(skb) < NETIUCV_HDRLEN) {
1382 IUCV_DBF_TEXT(data, 2, 1381 IUCV_DBF_TEXT(data, 2,
1383 "netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n"); 1382 "netiucv_tx: skb_headroom < NETIUCV_HDRLEN\n");
1384 dev_kfree_skb(skb); 1383 dev_kfree_skb(skb);
1385 privptr->stats.tx_dropped++; 1384 privptr->stats.tx_dropped++;
1386 return 0; 1385 return NETDEV_TX_OK;
1387 } 1386 }
1388 1387
1389 /** 1388 /**
@@ -1395,7 +1394,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev)
1395 privptr->stats.tx_dropped++; 1394 privptr->stats.tx_dropped++;
1396 privptr->stats.tx_errors++; 1395 privptr->stats.tx_errors++;
1397 privptr->stats.tx_carrier_errors++; 1396 privptr->stats.tx_carrier_errors++;
1398 return 0; 1397 return NETDEV_TX_OK;
1399 } 1398 }
1400 1399
1401 if (netiucv_test_and_set_busy(dev)) { 1400 if (netiucv_test_and_set_busy(dev)) {
diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
index 447e1d19581a..31a2b4e502ce 100644
--- a/drivers/s390/net/qeth_core.h
+++ b/drivers/s390/net/qeth_core.h
@@ -435,6 +435,7 @@ struct qeth_qdio_out_q {
435 * index of buffer to be filled by driver; state EMPTY or PACKING 435 * index of buffer to be filled by driver; state EMPTY or PACKING
436 */ 436 */
437 int next_buf_to_fill; 437 int next_buf_to_fill;
438 int sync_iqdio_error;
438 /* 439 /*
439 * number of buffers that are currently filled (PRIMED) 440 * number of buffers that are currently filled (PRIMED)
440 * -> these buffers are hardware-owned 441 * -> these buffers are hardware-owned
@@ -685,6 +686,14 @@ struct qeth_mc_mac {
685 int is_vmac; 686 int is_vmac;
686}; 687};
687 688
689struct qeth_skb_data {
690 __u32 magic;
691 int count;
692};
693
694#define QETH_SKB_MAGIC 0x71657468
695#define QETH_SIGA_CC2_RETRIES 3
696
688struct qeth_card { 697struct qeth_card {
689 struct list_head list; 698 struct list_head list;
690 enum qeth_card_states state; 699 enum qeth_card_states state;
@@ -834,7 +843,6 @@ int qeth_default_setadapterparms_cb(struct qeth_card *, struct qeth_reply *,
834int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *, 843int qeth_send_control_data(struct qeth_card *, int, struct qeth_cmd_buffer *,
835 int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long), 844 int (*reply_cb)(struct qeth_card *, struct qeth_reply*, unsigned long),
836 void *reply_param); 845 void *reply_param);
837int qeth_get_cast_type(struct qeth_card *, struct sk_buff *);
838int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int); 846int qeth_get_priority_queue(struct qeth_card *, struct sk_buff *, int, int);
839int qeth_get_elements_no(struct qeth_card *, void *, struct sk_buff *, int); 847int qeth_get_elements_no(struct qeth_card *, void *, struct sk_buff *, int);
840int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *, 848int qeth_do_send_packet_fast(struct qeth_card *, struct qeth_qdio_out_q *,
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index d53621c4acbb..c4a42d970158 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -927,8 +927,8 @@ out:
927 return; 927 return;
928} 928}
929 929
930static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue, 930static void __qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
931 struct qeth_qdio_out_buffer *buf) 931 struct qeth_qdio_out_buffer *buf, unsigned int qeth_skip_skb)
932{ 932{
933 int i; 933 int i;
934 struct sk_buff *skb; 934 struct sk_buff *skb;
@@ -937,11 +937,13 @@ static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
937 if (buf->buffer->element[0].flags & 0x40) 937 if (buf->buffer->element[0].flags & 0x40)
938 atomic_dec(&queue->set_pci_flags_count); 938 atomic_dec(&queue->set_pci_flags_count);
939 939
940 skb = skb_dequeue(&buf->skb_list); 940 if (!qeth_skip_skb) {
941 while (skb) {
942 atomic_dec(&skb->users);
943 dev_kfree_skb_any(skb);
944 skb = skb_dequeue(&buf->skb_list); 941 skb = skb_dequeue(&buf->skb_list);
942 while (skb) {
943 atomic_dec(&skb->users);
944 dev_kfree_skb_any(skb);
945 skb = skb_dequeue(&buf->skb_list);
946 }
945 } 947 }
946 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(queue->card); ++i) { 948 for (i = 0; i < QETH_MAX_BUFFER_ELEMENTS(queue->card); ++i) {
947 if (buf->buffer->element[i].addr && buf->is_header[i]) 949 if (buf->buffer->element[i].addr && buf->is_header[i])
@@ -957,6 +959,12 @@ static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
957 atomic_set(&buf->state, QETH_QDIO_BUF_EMPTY); 959 atomic_set(&buf->state, QETH_QDIO_BUF_EMPTY);
958} 960}
959 961
962static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
963 struct qeth_qdio_out_buffer *buf)
964{
965 __qeth_clear_output_buffer(queue, buf, 0);
966}
967
960void qeth_clear_qdio_buffers(struct qeth_card *card) 968void qeth_clear_qdio_buffers(struct qeth_card *card)
961{ 969{
962 int i, j; 970 int i, j;
@@ -1152,8 +1160,9 @@ static void qeth_core_sl_print(struct seq_file *m, struct service_level *slr)
1152{ 1160{
1153 struct qeth_card *card = container_of(slr, struct qeth_card, 1161 struct qeth_card *card = container_of(slr, struct qeth_card,
1154 qeth_service_level); 1162 qeth_service_level);
1155 seq_printf(m, "qeth: %s firmware level %s\n", CARD_BUS_ID(card), 1163 if (card->info.mcl_level[0])
1156 card->info.mcl_level); 1164 seq_printf(m, "qeth: %s firmware level %s\n",
1165 CARD_BUS_ID(card), card->info.mcl_level);
1157} 1166}
1158 1167
1159static struct qeth_card *qeth_alloc_card(void) 1168static struct qeth_card *qeth_alloc_card(void)
@@ -2685,6 +2694,13 @@ static int qeth_handle_send_error(struct qeth_card *card,
2685 int sbalf15 = buffer->buffer->element[15].flags & 0xff; 2694 int sbalf15 = buffer->buffer->element[15].flags & 0xff;
2686 2695
2687 QETH_DBF_TEXT(TRACE, 6, "hdsnderr"); 2696 QETH_DBF_TEXT(TRACE, 6, "hdsnderr");
2697 if (card->info.type == QETH_CARD_TYPE_IQD) {
2698 if (sbalf15 == 0) {
2699 qdio_err = 0;
2700 } else {
2701 qdio_err = 1;
2702 }
2703 }
2688 qeth_check_qdio_errors(buffer->buffer, qdio_err, "qouterr"); 2704 qeth_check_qdio_errors(buffer->buffer, qdio_err, "qouterr");
2689 2705
2690 if (!qdio_err) 2706 if (!qdio_err)
@@ -2817,6 +2833,7 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
2817 } 2833 }
2818 } 2834 }
2819 2835
2836 queue->sync_iqdio_error = 0;
2820 queue->card->dev->trans_start = jiffies; 2837 queue->card->dev->trans_start = jiffies;
2821 if (queue->card->options.performance_stats) { 2838 if (queue->card->options.performance_stats) {
2822 queue->card->perf_stats.outbound_do_qdio_cnt++; 2839 queue->card->perf_stats.outbound_do_qdio_cnt++;
@@ -2832,6 +2849,10 @@ static void qeth_flush_buffers(struct qeth_qdio_out_q *queue, int index,
2832 queue->card->perf_stats.outbound_do_qdio_time += 2849 queue->card->perf_stats.outbound_do_qdio_time +=
2833 qeth_get_micros() - 2850 qeth_get_micros() -
2834 queue->card->perf_stats.outbound_do_qdio_start_time; 2851 queue->card->perf_stats.outbound_do_qdio_start_time;
2852 if (rc > 0) {
2853 if (!(rc & QDIO_ERROR_SIGA_BUSY))
2854 queue->sync_iqdio_error = rc & 3;
2855 }
2835 if (rc) { 2856 if (rc) {
2836 queue->card->stats.tx_errors += count; 2857 queue->card->stats.tx_errors += count;
2837 /* ignore temporary SIGA errors without busy condition */ 2858 /* ignore temporary SIGA errors without busy condition */
@@ -2899,6 +2920,7 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
2899 struct qeth_qdio_out_q *queue = card->qdio.out_qs[__queue]; 2920 struct qeth_qdio_out_q *queue = card->qdio.out_qs[__queue];
2900 struct qeth_qdio_out_buffer *buffer; 2921 struct qeth_qdio_out_buffer *buffer;
2901 int i; 2922 int i;
2923 unsigned qeth_send_err;
2902 2924
2903 QETH_DBF_TEXT(TRACE, 6, "qdouhdl"); 2925 QETH_DBF_TEXT(TRACE, 6, "qdouhdl");
2904 if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) { 2926 if (qdio_error & QDIO_ERROR_ACTIVATE_CHECK_CONDITION) {
@@ -2915,8 +2937,9 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
2915 } 2937 }
2916 for (i = first_element; i < (first_element + count); ++i) { 2938 for (i = first_element; i < (first_element + count); ++i) {
2917 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; 2939 buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q];
2918 qeth_handle_send_error(card, buffer, qdio_error); 2940 qeth_send_err = qeth_handle_send_error(card, buffer, qdio_error);
2919 qeth_clear_output_buffer(queue, buffer); 2941 __qeth_clear_output_buffer(queue, buffer,
2942 (qeth_send_err == QETH_SEND_ERROR_RETRY) ? 1 : 0);
2920 } 2943 }
2921 atomic_sub(count, &queue->used_buffers); 2944 atomic_sub(count, &queue->used_buffers);
2922 /* check if we need to do something on this outbound queue */ 2945 /* check if we need to do something on this outbound queue */
@@ -2930,55 +2953,6 @@ void qeth_qdio_output_handler(struct ccw_device *ccwdev,
2930} 2953}
2931EXPORT_SYMBOL_GPL(qeth_qdio_output_handler); 2954EXPORT_SYMBOL_GPL(qeth_qdio_output_handler);
2932 2955
2933int qeth_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
2934{
2935 int cast_type = RTN_UNSPEC;
2936
2937 if (card->info.type == QETH_CARD_TYPE_OSN)
2938 return cast_type;
2939
2940 if (skb_dst(skb) && skb_dst(skb)->neighbour) {
2941 cast_type = skb_dst(skb)->neighbour->type;
2942 if ((cast_type == RTN_BROADCAST) ||
2943 (cast_type == RTN_MULTICAST) ||
2944 (cast_type == RTN_ANYCAST))
2945 return cast_type;
2946 else
2947 return RTN_UNSPEC;
2948 }
2949 /* try something else */
2950 if (skb->protocol == ETH_P_IPV6)
2951 return (skb_network_header(skb)[24] == 0xff) ?
2952 RTN_MULTICAST : 0;
2953 else if (skb->protocol == ETH_P_IP)
2954 return ((skb_network_header(skb)[16] & 0xf0) == 0xe0) ?
2955 RTN_MULTICAST : 0;
2956 /* ... */
2957 if (!memcmp(skb->data, skb->dev->broadcast, 6))
2958 return RTN_BROADCAST;
2959 else {
2960 u16 hdr_mac;
2961
2962 hdr_mac = *((u16 *)skb->data);
2963 /* tr multicast? */
2964 switch (card->info.link_type) {
2965 case QETH_LINK_TYPE_HSTR:
2966 case QETH_LINK_TYPE_LANE_TR:
2967 if ((hdr_mac == QETH_TR_MAC_NC) ||
2968 (hdr_mac == QETH_TR_MAC_C))
2969 return RTN_MULTICAST;
2970 break;
2971 /* eth or so multicast? */
2972 default:
2973 if ((hdr_mac == QETH_ETH_MAC_V4) ||
2974 (hdr_mac == QETH_ETH_MAC_V6))
2975 return RTN_MULTICAST;
2976 }
2977 }
2978 return cast_type;
2979}
2980EXPORT_SYMBOL_GPL(qeth_get_cast_type);
2981
2982int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb, 2956int qeth_get_priority_queue(struct qeth_card *card, struct sk_buff *skb,
2983 int ipv, int cast_type) 2957 int ipv, int cast_type)
2984{ 2958{
@@ -3159,7 +3133,10 @@ int qeth_do_send_packet_fast(struct qeth_card *card,
3159 int offset, int hd_len) 3133 int offset, int hd_len)
3160{ 3134{
3161 struct qeth_qdio_out_buffer *buffer; 3135 struct qeth_qdio_out_buffer *buffer;
3136 struct sk_buff *skb1;
3137 struct qeth_skb_data *retry_ctrl;
3162 int index; 3138 int index;
3139 int rc;
3163 3140
3164 /* spin until we get the queue ... */ 3141 /* spin until we get the queue ... */
3165 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED, 3142 while (atomic_cmpxchg(&queue->state, QETH_OUT_Q_UNLOCKED,
@@ -3178,6 +3155,25 @@ int qeth_do_send_packet_fast(struct qeth_card *card,
3178 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED); 3155 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
3179 qeth_fill_buffer(queue, buffer, skb, hdr, offset, hd_len); 3156 qeth_fill_buffer(queue, buffer, skb, hdr, offset, hd_len);
3180 qeth_flush_buffers(queue, index, 1); 3157 qeth_flush_buffers(queue, index, 1);
3158 if (queue->sync_iqdio_error == 2) {
3159 skb1 = skb_dequeue(&buffer->skb_list);
3160 while (skb1) {
3161 atomic_dec(&skb1->users);
3162 skb1 = skb_dequeue(&buffer->skb_list);
3163 }
3164 retry_ctrl = (struct qeth_skb_data *) &skb->cb[16];
3165 if (retry_ctrl->magic != QETH_SKB_MAGIC) {
3166 retry_ctrl->magic = QETH_SKB_MAGIC;
3167 retry_ctrl->count = 0;
3168 }
3169 if (retry_ctrl->count < QETH_SIGA_CC2_RETRIES) {
3170 retry_ctrl->count++;
3171 rc = dev_queue_xmit(skb);
3172 } else {
3173 dev_kfree_skb_any(skb);
3174 QETH_DBF_TEXT(QERR, 2, "qrdrop");
3175 }
3176 }
3181 return 0; 3177 return 0;
3182out: 3178out:
3183 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED); 3179 atomic_set(&queue->state, QETH_OUT_Q_UNLOCKED);
diff --git a/drivers/s390/net/qeth_core_sys.c b/drivers/s390/net/qeth_core_sys.c
index 568465d7517f..33505c2a0e3a 100644
--- a/drivers/s390/net/qeth_core_sys.c
+++ b/drivers/s390/net/qeth_core_sys.c
@@ -364,7 +364,7 @@ static ssize_t qeth_dev_layer2_show(struct device *dev,
364 if (!card) 364 if (!card)
365 return -EINVAL; 365 return -EINVAL;
366 366
367 return sprintf(buf, "%i\n", card->options.layer2 ? 1:0); 367 return sprintf(buf, "%i\n", card->options.layer2);
368} 368}
369 369
370static ssize_t qeth_dev_layer2_store(struct device *dev, 370static ssize_t qeth_dev_layer2_store(struct device *dev,
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 691cecd03b83..f4f3ca1393b2 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -216,36 +216,16 @@ static void qeth_l2_del_all_mc(struct qeth_card *card)
216 spin_unlock_bh(&card->mclock); 216 spin_unlock_bh(&card->mclock);
217} 217}
218 218
219static void qeth_l2_get_packet_type(struct qeth_card *card, 219static inline int qeth_l2_get_cast_type(struct qeth_card *card,
220 struct qeth_hdr *hdr, struct sk_buff *skb) 220 struct sk_buff *skb)
221{ 221{
222 __u16 hdr_mac; 222 if (card->info.type == QETH_CARD_TYPE_OSN)
223 223 return RTN_UNSPEC;
224 if (!memcmp(skb->data + QETH_HEADER_SIZE, 224 if (is_broadcast_ether_addr(skb->data))
225 skb->dev->broadcast, 6)) { 225 return RTN_BROADCAST;
226 /* broadcast? */ 226 if (is_multicast_ether_addr(skb->data))
227 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_BROADCAST; 227 return RTN_MULTICAST;
228 return; 228 return RTN_UNSPEC;
229 }
230 hdr_mac = *((__u16 *)skb->data);
231 /* tr multicast? */
232 switch (card->info.link_type) {
233 case QETH_LINK_TYPE_HSTR:
234 case QETH_LINK_TYPE_LANE_TR:
235 if ((hdr_mac == QETH_TR_MAC_NC) ||
236 (hdr_mac == QETH_TR_MAC_C))
237 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_MULTICAST;
238 else
239 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST;
240 break;
241 /* eth or so multicast? */
242 default:
243 if ((hdr_mac == QETH_ETH_MAC_V4) ||
244 (hdr_mac == QETH_ETH_MAC_V6))
245 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_MULTICAST;
246 else
247 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST;
248 }
249} 229}
250 230
251static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, 231static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
@@ -262,7 +242,7 @@ static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
262 else if (cast_type == RTN_BROADCAST) 242 else if (cast_type == RTN_BROADCAST)
263 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_BROADCAST; 243 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_BROADCAST;
264 else 244 else
265 qeth_l2_get_packet_type(card, hdr, skb); 245 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST;
266 246
267 hdr->hdr.l2.pkt_length = skb->len-QETH_HEADER_SIZE; 247 hdr->hdr.l2.pkt_length = skb->len-QETH_HEADER_SIZE;
268 /* VSWITCH relies on the VLAN 248 /* VSWITCH relies on the VLAN
@@ -469,7 +449,6 @@ static void qeth_l2_process_inbound_buffer(struct qeth_card *card,
469 QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN); 449 QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
470 continue; 450 continue;
471 } 451 }
472 card->dev->last_rx = jiffies;
473 card->stats.rx_packets++; 452 card->stats.rx_packets++;
474 card->stats.rx_bytes += len; 453 card->stats.rx_bytes += len;
475 } 454 }
@@ -672,7 +651,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
672 struct qeth_card *card = dev->ml_priv; 651 struct qeth_card *card = dev->ml_priv;
673 struct sk_buff *new_skb = skb; 652 struct sk_buff *new_skb = skb;
674 int ipv = qeth_get_ip_version(skb); 653 int ipv = qeth_get_ip_version(skb);
675 int cast_type = qeth_get_cast_type(card, skb); 654 int cast_type = qeth_l2_get_cast_type(card, skb);
676 struct qeth_qdio_out_q *queue = card->qdio.out_qs 655 struct qeth_qdio_out_q *queue = card->qdio.out_qs
677 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; 656 [qeth_get_priority_queue(card, skb, ipv, cast_type)];
678 int tx_bytes = skb->len; 657 int tx_bytes = skb->len;
@@ -744,6 +723,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
744 card->stats.tx_bytes += tx_bytes; 723 card->stats.tx_bytes += tx_bytes;
745 if (new_skb != skb) 724 if (new_skb != skb)
746 dev_kfree_skb_any(skb); 725 dev_kfree_skb_any(skb);
726 rc = NETDEV_TX_OK;
747 } else { 727 } else {
748 if (data_offset >= 0) 728 if (data_offset >= 0)
749 kmem_cache_free(qeth_core_header_cache, hdr); 729 kmem_cache_free(qeth_core_header_cache, hdr);
@@ -882,7 +862,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
882 return; 862 return;
883} 863}
884 864
885static struct ethtool_ops qeth_l2_ethtool_ops = { 865static const struct ethtool_ops qeth_l2_ethtool_ops = {
886 .get_link = ethtool_op_get_link, 866 .get_link = ethtool_op_get_link,
887 .get_strings = qeth_core_get_strings, 867 .get_strings = qeth_core_get_strings,
888 .get_ethtool_stats = qeth_core_get_ethtool_stats, 868 .get_ethtool_stats = qeth_core_get_ethtool_stats,
@@ -891,7 +871,7 @@ static struct ethtool_ops qeth_l2_ethtool_ops = {
891 .get_settings = qeth_core_ethtool_get_settings, 871 .get_settings = qeth_core_ethtool_get_settings,
892}; 872};
893 873
894static struct ethtool_ops qeth_l2_osn_ops = { 874static const struct ethtool_ops qeth_l2_osn_ops = {
895 .get_strings = qeth_core_get_strings, 875 .get_strings = qeth_core_get_strings,
896 .get_ethtool_stats = qeth_core_get_ethtool_stats, 876 .get_ethtool_stats = qeth_core_get_ethtool_stats,
897 .get_stats_count = qeth_core_get_stats_count, 877 .get_stats_count = qeth_core_get_stats_count,
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 54872406864e..073b6d354915 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -1987,7 +1987,6 @@ static void qeth_l3_process_inbound_buffer(struct qeth_card *card,
1987 continue; 1987 continue;
1988 } 1988 }
1989 1989
1990 card->dev->last_rx = jiffies;
1991 card->stats.rx_packets++; 1990 card->stats.rx_packets++;
1992 card->stats.rx_bytes += len; 1991 card->stats.rx_bytes += len;
1993 } 1992 }
@@ -2525,6 +2524,51 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2525 return rc; 2524 return rc;
2526} 2525}
2527 2526
2527int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
2528{
2529 int cast_type = RTN_UNSPEC;
2530
2531 if (skb_dst(skb) && skb_dst(skb)->neighbour) {
2532 cast_type = skb_dst(skb)->neighbour->type;
2533 if ((cast_type == RTN_BROADCAST) ||
2534 (cast_type == RTN_MULTICAST) ||
2535 (cast_type == RTN_ANYCAST))
2536 return cast_type;
2537 else
2538 return RTN_UNSPEC;
2539 }
2540 /* try something else */
2541 if (skb->protocol == ETH_P_IPV6)
2542 return (skb_network_header(skb)[24] == 0xff) ?
2543 RTN_MULTICAST : 0;
2544 else if (skb->protocol == ETH_P_IP)
2545 return ((skb_network_header(skb)[16] & 0xf0) == 0xe0) ?
2546 RTN_MULTICAST : 0;
2547 /* ... */
2548 if (!memcmp(skb->data, skb->dev->broadcast, 6))
2549 return RTN_BROADCAST;
2550 else {
2551 u16 hdr_mac;
2552
2553 hdr_mac = *((u16 *)skb->data);
2554 /* tr multicast? */
2555 switch (card->info.link_type) {
2556 case QETH_LINK_TYPE_HSTR:
2557 case QETH_LINK_TYPE_LANE_TR:
2558 if ((hdr_mac == QETH_TR_MAC_NC) ||
2559 (hdr_mac == QETH_TR_MAC_C))
2560 return RTN_MULTICAST;
2561 break;
2562 /* eth or so multicast? */
2563 default:
2564 if ((hdr_mac == QETH_ETH_MAC_V4) ||
2565 (hdr_mac == QETH_ETH_MAC_V6))
2566 return RTN_MULTICAST;
2567 }
2568 }
2569 return cast_type;
2570}
2571
2528static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, 2572static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
2529 struct sk_buff *skb, int ipv, int cast_type) 2573 struct sk_buff *skb, int ipv, int cast_type)
2530{ 2574{
@@ -2650,7 +2694,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
2650 struct qeth_card *card = dev->ml_priv; 2694 struct qeth_card *card = dev->ml_priv;
2651 struct sk_buff *new_skb = NULL; 2695 struct sk_buff *new_skb = NULL;
2652 int ipv = qeth_get_ip_version(skb); 2696 int ipv = qeth_get_ip_version(skb);
2653 int cast_type = qeth_get_cast_type(card, skb); 2697 int cast_type = qeth_l3_get_cast_type(card, skb);
2654 struct qeth_qdio_out_q *queue = card->qdio.out_qs 2698 struct qeth_qdio_out_q *queue = card->qdio.out_qs
2655 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; 2699 [qeth_get_priority_queue(card, skb, ipv, cast_type)];
2656 int tx_bytes = skb->len; 2700 int tx_bytes = skb->len;
@@ -2793,6 +2837,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
2793 card->perf_stats.sg_frags_sent += nr_frags + 1; 2837 card->perf_stats.sg_frags_sent += nr_frags + 1;
2794 } 2838 }
2795 } 2839 }
2840 rc = NETDEV_TX_OK;
2796 } else { 2841 } else {
2797 if (data_offset >= 0) 2842 if (data_offset >= 0)
2798 kmem_cache_free(qeth_core_header_cache, hdr); 2843 kmem_cache_free(qeth_core_header_cache, hdr);
@@ -2900,7 +2945,7 @@ static int qeth_l3_ethtool_set_tso(struct net_device *dev, u32 data)
2900 return 0; 2945 return 0;
2901} 2946}
2902 2947
2903static struct ethtool_ops qeth_l3_ethtool_ops = { 2948static const struct ethtool_ops qeth_l3_ethtool_ops = {
2904 .get_link = ethtool_op_get_link, 2949 .get_link = ethtool_op_get_link,
2905 .get_tx_csum = ethtool_op_get_tx_csum, 2950 .get_tx_csum = ethtool_op_get_tx_csum,
2906 .set_tx_csum = ethtool_op_set_tx_hw_csum, 2951 .set_tx_csum = ethtool_op_set_tx_hw_csum,
@@ -3179,6 +3224,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
3179 netif_carrier_on(card->dev); 3224 netif_carrier_on(card->dev);
3180 3225
3181 qeth_set_allowed_threads(card, 0xffffffff, 0); 3226 qeth_set_allowed_threads(card, 0xffffffff, 0);
3227 qeth_l3_set_ip_addr_list(card);
3182 if (recover_flag == CARD_STATE_RECOVER) { 3228 if (recover_flag == CARD_STATE_RECOVER) {
3183 if (recovery_mode) 3229 if (recovery_mode)
3184 qeth_l3_open(card->dev); 3230 qeth_l3_open(card->dev);