aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/claw.c1
-rw-r--r--drivers/s390/net/ctcmain.c1
-rw-r--r--drivers/s390/net/lcs.c12
-rw-r--r--drivers/s390/net/lcs.h1
-rw-r--r--drivers/s390/net/netiucv.c1
-rw-r--r--drivers/s390/net/qeth.h3
-rw-r--r--drivers/s390/net/qeth_eddp.c16
-rw-r--r--drivers/s390/net/qeth_main.c73
8 files changed, 63 insertions, 45 deletions
diff --git a/drivers/s390/net/claw.c b/drivers/s390/net/claw.c
index 023455a0b34a..399695f7b1af 100644
--- a/drivers/s390/net/claw.c
+++ b/drivers/s390/net/claw.c
@@ -3891,7 +3891,6 @@ claw_init_netdevice(struct net_device * dev)
3891 dev->type = ARPHRD_SLIP; 3891 dev->type = ARPHRD_SLIP;
3892 dev->tx_queue_len = 1300; 3892 dev->tx_queue_len = 1300;
3893 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 3893 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
3894 SET_MODULE_OWNER(dev);
3895#ifdef FUNCTRACE 3894#ifdef FUNCTRACE
3896 printk(KERN_INFO "%s:%s Exit\n",dev->name,__FUNCTION__); 3895 printk(KERN_INFO "%s:%s Exit\n",dev->name,__FUNCTION__);
3897#endif 3896#endif
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 92e8a37b5022..449937233732 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -2823,7 +2823,6 @@ ctc_init_netdevice(struct net_device * dev, int alloc_device,
2823 dev->type = ARPHRD_SLIP; 2823 dev->type = ARPHRD_SLIP;
2824 dev->tx_queue_len = 100; 2824 dev->tx_queue_len = 100;
2825 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 2825 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
2826 SET_MODULE_OWNER(dev);
2827 return dev; 2826 return dev;
2828} 2827}
2829 2828
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 08a994fdd1a4..0fd663b23d76 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1400,11 +1400,14 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
1400 PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", 1400 PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n",
1401 cdev->dev.bus_id, dstat, cstat); 1401 cdev->dev.bus_id, dstat, cstat);
1402 if (rc) { 1402 if (rc) {
1403 lcs_schedule_recovery(card); 1403 channel->state = LCS_CH_STATE_ERROR;
1404 wake_up(&card->wait_q);
1405 return;
1406 } 1404 }
1407 } 1405 }
1406 if (channel->state == LCS_CH_STATE_ERROR) {
1407 lcs_schedule_recovery(card);
1408 wake_up(&card->wait_q);
1409 return;
1410 }
1408 /* How far in the ccw chain have we processed? */ 1411 /* How far in the ccw chain have we processed? */
1409 if ((channel->state != LCS_CH_STATE_INIT) && 1412 if ((channel->state != LCS_CH_STATE_INIT) &&
1410 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { 1413 (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
@@ -1708,6 +1711,8 @@ lcs_stopcard(struct lcs_card *card)
1708 1711
1709 if (card->read.state != LCS_CH_STATE_STOPPED && 1712 if (card->read.state != LCS_CH_STATE_STOPPED &&
1710 card->write.state != LCS_CH_STATE_STOPPED && 1713 card->write.state != LCS_CH_STATE_STOPPED &&
1714 card->read.state != LCS_CH_STATE_ERROR &&
1715 card->write.state != LCS_CH_STATE_ERROR &&
1711 card->state == DEV_STATE_UP) { 1716 card->state == DEV_STATE_UP) {
1712 lcs_clear_multicast_list(card); 1717 lcs_clear_multicast_list(card);
1713 rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP); 1718 rc = lcs_send_stoplan(card,LCS_INITIATOR_TCPIP);
@@ -2145,7 +2150,6 @@ lcs_new_device(struct ccwgroup_device *ccwgdev)
2145 card->dev->stop = lcs_stop_device; 2150 card->dev->stop = lcs_stop_device;
2146 card->dev->hard_start_xmit = lcs_start_xmit; 2151 card->dev->hard_start_xmit = lcs_start_xmit;
2147 card->dev->get_stats = lcs_getstats; 2152 card->dev->get_stats = lcs_getstats;
2148 SET_MODULE_OWNER(dev);
2149 memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH); 2153 memcpy(card->dev->dev_addr, card->mac, LCS_MAC_LENGTH);
2150#ifdef CONFIG_IP_MULTICAST 2154#ifdef CONFIG_IP_MULTICAST
2151 if (!lcs_check_multicast_support(card)) 2155 if (!lcs_check_multicast_support(card))
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h
index 0e1e4a0a88f0..8976fb0b070a 100644
--- a/drivers/s390/net/lcs.h
+++ b/drivers/s390/net/lcs.h
@@ -138,6 +138,7 @@ enum lcs_channel_states {
138 LCS_CH_STATE_RUNNING, 138 LCS_CH_STATE_RUNNING,
139 LCS_CH_STATE_SUSPENDED, 139 LCS_CH_STATE_SUSPENDED,
140 LCS_CH_STATE_CLEARED, 140 LCS_CH_STATE_CLEARED,
141 LCS_CH_STATE_ERROR,
141}; 142};
142 143
143/** 144/**
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 268889474339..4d18d6419ddc 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1904,7 +1904,6 @@ static void netiucv_setup_netdevice(struct net_device *dev)
1904 dev->type = ARPHRD_SLIP; 1904 dev->type = ARPHRD_SLIP;
1905 dev->tx_queue_len = NETIUCV_QUEUELEN_DEFAULT; 1905 dev->tx_queue_len = NETIUCV_QUEUELEN_DEFAULT;
1906 dev->flags = IFF_POINTOPOINT | IFF_NOARP; 1906 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
1907 SET_MODULE_OWNER(dev);
1908} 1907}
1909 1908
1910/** 1909/**
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 6d4959807abc..8c6b72d05b1d 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -833,8 +833,7 @@ struct qeth_card {
833 struct qeth_qdio_info qdio; 833 struct qeth_qdio_info qdio;
834 struct qeth_perf_stats perf_stats; 834 struct qeth_perf_stats perf_stats;
835 int use_hard_stop; 835 int use_hard_stop;
836 int (*orig_hard_header)(struct sk_buff *,struct net_device *, 836 const struct header_ops *orig_header_ops;
837 unsigned short,void *,void *,unsigned);
838 struct qeth_osn_info osn_info; 837 struct qeth_osn_info osn_info;
839 atomic_t force_alloc_skb; 838 atomic_t force_alloc_skb;
840}; 839};
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c
index 70108fb16906..e3c268cfbffe 100644
--- a/drivers/s390/net/qeth_eddp.c
+++ b/drivers/s390/net/qeth_eddp.c
@@ -159,13 +159,15 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue,
159 buffer = buf->buffer; 159 buffer = buf->buffer;
160 /* fill one skb into buffer */ 160 /* fill one skb into buffer */
161 for (i = 0; i < ctx->elements_per_skb; ++i){ 161 for (i = 0; i < ctx->elements_per_skb; ++i){
162 buffer->element[buf->next_element_to_fill].addr = 162 if (ctx->elements[element].length != 0) {
163 ctx->elements[element].addr; 163 buffer->element[buf->next_element_to_fill].
164 buffer->element[buf->next_element_to_fill].length = 164 addr = ctx->elements[element].addr;
165 ctx->elements[element].length; 165 buffer->element[buf->next_element_to_fill].
166 buffer->element[buf->next_element_to_fill].flags = 166 length = ctx->elements[element].length;
167 ctx->elements[element].flags; 167 buffer->element[buf->next_element_to_fill].
168 buf->next_element_to_fill++; 168 flags = ctx->elements[element].flags;
169 buf->next_element_to_fill++;
170 }
169 element++; 171 element++;
170 elements--; 172 elements--;
171 } 173 }
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index f3e6fbeb2123..a2d08c9ba3c4 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -160,6 +160,9 @@ qeth_set_multicast_list(struct net_device *);
160static void 160static void
161qeth_setadp_promisc_mode(struct qeth_card *); 161qeth_setadp_promisc_mode(struct qeth_card *);
162 162
163static int
164qeth_hard_header_parse(const struct sk_buff *skb, unsigned char *haddr);
165
163static void 166static void
164qeth_notify_processes(void) 167qeth_notify_processes(void)
165{ 168{
@@ -820,14 +823,15 @@ __qeth_delete_all_mc(struct qeth_card *card, unsigned long *flags)
820again: 823again:
821 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) { 824 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) {
822 if (addr->is_multicast) { 825 if (addr->is_multicast) {
826 list_del(&addr->entry);
823 spin_unlock_irqrestore(&card->ip_lock, *flags); 827 spin_unlock_irqrestore(&card->ip_lock, *flags);
824 rc = qeth_deregister_addr_entry(card, addr); 828 rc = qeth_deregister_addr_entry(card, addr);
825 spin_lock_irqsave(&card->ip_lock, *flags); 829 spin_lock_irqsave(&card->ip_lock, *flags);
826 if (!rc) { 830 if (!rc) {
827 list_del(&addr->entry);
828 kfree(addr); 831 kfree(addr);
829 goto again; 832 goto again;
830 } 833 } else
834 list_add(&addr->entry, &card->ip_list);
831 } 835 }
832 } 836 }
833} 837}
@@ -2698,10 +2702,15 @@ qeth_process_inbound_buffer(struct qeth_card *card,
2698 qeth_layer2_rebuild_skb(card, skb, hdr); 2702 qeth_layer2_rebuild_skb(card, skb, hdr);
2699 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) 2703 else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3)
2700 vlan_tag = qeth_rebuild_skb(card, skb, hdr); 2704 vlan_tag = qeth_rebuild_skb(card, skb, hdr);
2701 else { /*in case of OSN*/ 2705 else if (hdr->hdr.osn.id == QETH_HEADER_TYPE_OSN) {
2702 skb_push(skb, sizeof(struct qeth_hdr)); 2706 skb_push(skb, sizeof(struct qeth_hdr));
2703 skb_copy_to_linear_data(skb, hdr, 2707 skb_copy_to_linear_data(skb, hdr,
2704 sizeof(struct qeth_hdr)); 2708 sizeof(struct qeth_hdr));
2709 } else { /* unknown header type */
2710 dev_kfree_skb_any(skb);
2711 QETH_DBF_TEXT(trace, 3, "inbunkno");
2712 QETH_DBF_HEX(control, 3, hdr, QETH_DBF_CONTROL_LEN);
2713 continue;
2705 } 2714 }
2706 /* is device UP ? */ 2715 /* is device UP ? */
2707 if (!(card->dev->flags & IFF_UP)){ 2716 if (!(card->dev->flags & IFF_UP)){
@@ -3787,8 +3796,8 @@ qeth_get_netdevice(enum qeth_card_types type, enum qeth_link_types linktype)
3787/*hard_header fake function; used in case fake_ll is set */ 3796/*hard_header fake function; used in case fake_ll is set */
3788static int 3797static int
3789qeth_fake_header(struct sk_buff *skb, struct net_device *dev, 3798qeth_fake_header(struct sk_buff *skb, struct net_device *dev,
3790 unsigned short type, void *daddr, void *saddr, 3799 unsigned short type, const void *daddr, const void *saddr,
3791 unsigned len) 3800 unsigned len)
3792{ 3801{
3793 if(dev->type == ARPHRD_IEEE802_TR){ 3802 if(dev->type == ARPHRD_IEEE802_TR){
3794 struct trh_hdr *hdr; 3803 struct trh_hdr *hdr;
@@ -3811,6 +3820,11 @@ qeth_fake_header(struct sk_buff *skb, struct net_device *dev,
3811 } 3820 }
3812} 3821}
3813 3822
3823static const struct header_ops qeth_fake_ops = {
3824 .create = qeth_fake_header,
3825 .parse = qeth_hard_header_parse,
3826};
3827
3814static int 3828static int
3815qeth_send_packet(struct qeth_card *, struct sk_buff *); 3829qeth_send_packet(struct qeth_card *, struct sk_buff *);
3816 3830
@@ -4500,7 +4514,8 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
4500 /* check if we have enough elements (including following 4514 /* check if we have enough elements (including following
4501 * free buffers) to handle eddp context */ 4515 * free buffers) to handle eddp context */
4502 if (qeth_eddp_check_buffers_for_context(queue,ctx) < 0){ 4516 if (qeth_eddp_check_buffers_for_context(queue,ctx) < 0){
4503 printk("eddp tx_dropped 1\n"); 4517 if (net_ratelimit())
4518 PRINT_WARN("eddp tx_dropped 1\n");
4504 rc = -EBUSY; 4519 rc = -EBUSY;
4505 goto out; 4520 goto out;
4506 } 4521 }
@@ -4649,7 +4664,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4649 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; 4664 [qeth_get_priority_queue(card, skb, ipv, cast_type)];
4650 if (!card->options.layer2) { 4665 if (!card->options.layer2) {
4651 ipv = qeth_get_ip_version(skb); 4666 ipv = qeth_get_ip_version(skb);
4652 if ((card->dev->hard_header == qeth_fake_header) && ipv) { 4667 if ((card->dev->header_ops == &qeth_fake_ops) && ipv) {
4653 new_skb = qeth_pskb_unshare(skb, GFP_ATOMIC); 4668 new_skb = qeth_pskb_unshare(skb, GFP_ATOMIC);
4654 if (!new_skb) 4669 if (!new_skb)
4655 return -ENOMEM; 4670 return -ENOMEM;
@@ -4711,8 +4726,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4711 rc = qeth_do_send_packet(card, queue, new_skb, hdr, 4726 rc = qeth_do_send_packet(card, queue, new_skb, hdr,
4712 elements_needed, ctx); 4727 elements_needed, ctx);
4713 else { 4728 else {
4714 if ((skb->protocol == htons(ETH_P_ARP)) && 4729 if ((!card->options.layer2) &&
4715 (card->dev->flags & IFF_NOARP)) { 4730 (ipv == 0)) {
4716 __qeth_free_new_skb(skb, new_skb); 4731 __qeth_free_new_skb(skb, new_skb);
4717 return -EPERM; 4732 return -EPERM;
4718 } 4733 }
@@ -6561,12 +6576,16 @@ static struct ethtool_ops qeth_ethtool_ops = {
6561}; 6576};
6562 6577
6563static int 6578static int
6564qeth_hard_header_parse(struct sk_buff *skb, unsigned char *haddr) 6579qeth_hard_header_parse(const struct sk_buff *skb, unsigned char *haddr)
6565{ 6580{
6566 struct qeth_card *card; 6581 const struct qeth_card *card;
6567 struct ethhdr *eth; 6582 const struct ethhdr *eth;
6583 struct net_device *dev = skb->dev;
6568 6584
6569 card = qeth_get_card_from_dev(skb->dev); 6585 if (dev->type != ARPHRD_IEEE802_TR)
6586 return 0;
6587
6588 card = qeth_get_card_from_dev(dev);
6570 if (card->options.layer2) 6589 if (card->options.layer2)
6571 goto haveheader; 6590 goto haveheader;
6572#ifdef CONFIG_QETH_IPV6 6591#ifdef CONFIG_QETH_IPV6
@@ -6596,6 +6615,10 @@ haveheader:
6596 return ETH_ALEN; 6615 return ETH_ALEN;
6597} 6616}
6598 6617
6618static const struct header_ops qeth_null_ops = {
6619 .parse = qeth_hard_header_parse,
6620};
6621
6599static int 6622static int
6600qeth_netdev_init(struct net_device *dev) 6623qeth_netdev_init(struct net_device *dev)
6601{ 6624{
@@ -6620,12 +6643,8 @@ qeth_netdev_init(struct net_device *dev)
6620 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; 6643 dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid;
6621 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; 6644 dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid;
6622#endif 6645#endif
6623 if (qeth_get_netdev_flags(card) & IFF_NOARP) { 6646 dev->header_ops = &qeth_null_ops;
6624 dev->rebuild_header = NULL; 6647
6625 dev->hard_header = NULL;
6626 dev->header_cache_update = NULL;
6627 dev->hard_header_cache = NULL;
6628 }
6629#ifdef CONFIG_QETH_IPV6 6648#ifdef CONFIG_QETH_IPV6
6630 /*IPv6 address autoconfiguration stuff*/ 6649 /*IPv6 address autoconfiguration stuff*/
6631 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) 6650 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD))
@@ -6633,11 +6652,8 @@ qeth_netdev_init(struct net_device *dev)
6633#endif 6652#endif
6634 if (card->options.fake_ll && 6653 if (card->options.fake_ll &&
6635 (qeth_get_netdev_flags(card) & IFF_NOARP)) 6654 (qeth_get_netdev_flags(card) & IFF_NOARP))
6636 dev->hard_header = qeth_fake_header; 6655 dev->header_ops = &qeth_fake_ops;
6637 if (dev->type == ARPHRD_IEEE802_TR) 6656
6638 dev->hard_header_parse = NULL;
6639 else
6640 dev->hard_header_parse = qeth_hard_header_parse;
6641 dev->set_mac_address = qeth_layer2_set_mac_address; 6657 dev->set_mac_address = qeth_layer2_set_mac_address;
6642 dev->flags |= qeth_get_netdev_flags(card); 6658 dev->flags |= qeth_get_netdev_flags(card);
6643 if ((card->options.fake_broadcast) || 6659 if ((card->options.fake_broadcast) ||
@@ -6649,7 +6665,6 @@ qeth_netdev_init(struct net_device *dev)
6649 dev->mtu = card->info.initial_mtu; 6665 dev->mtu = card->info.initial_mtu;
6650 if (card->info.type != QETH_CARD_TYPE_OSN) 6666 if (card->info.type != QETH_CARD_TYPE_OSN)
6651 SET_ETHTOOL_OPS(dev, &qeth_ethtool_ops); 6667 SET_ETHTOOL_OPS(dev, &qeth_ethtool_ops);
6652 SET_MODULE_OWNER(dev);
6653 return 0; 6668 return 0;
6654} 6669}
6655 6670
@@ -6741,10 +6756,10 @@ retry:
6741 } 6756 }
6742 /*network device will be recovered*/ 6757 /*network device will be recovered*/
6743 if (card->dev) { 6758 if (card->dev) {
6744 card->dev->hard_header = card->orig_hard_header; 6759 card->dev->header_ops = card->orig_header_ops;
6745 if (card->options.fake_ll && 6760 if (card->options.fake_ll &&
6746 (qeth_get_netdev_flags(card) & IFF_NOARP)) 6761 (qeth_get_netdev_flags(card) & IFF_NOARP))
6747 card->dev->hard_header = qeth_fake_header; 6762 card->dev->header_ops = &qeth_fake_ops;
6748 return 0; 6763 return 0;
6749 } 6764 }
6750 /* at first set_online allocate netdev */ 6765 /* at first set_online allocate netdev */
@@ -6758,7 +6773,7 @@ retry:
6758 goto out; 6773 goto out;
6759 } 6774 }
6760 card->dev->priv = card; 6775 card->dev->priv = card;
6761 card->orig_hard_header = card->dev->hard_header; 6776 card->orig_header_ops = card->dev->header_ops;
6762 card->dev->type = qeth_get_arphdr_type(card->info.type, 6777 card->dev->type = qeth_get_arphdr_type(card->info.type,
6763 card->info.link_type); 6778 card->info.link_type);
6764 card->dev->init = qeth_netdev_init; 6779 card->dev->init = qeth_netdev_init;
@@ -8309,7 +8324,7 @@ qeth_arp_constructor(struct neighbour *neigh)
8309 if (card == NULL) 8324 if (card == NULL)
8310 goto out; 8325 goto out;
8311 if((card->options.layer2) || 8326 if((card->options.layer2) ||
8312 (card->dev->hard_header == qeth_fake_header)) 8327 (card->dev->header_ops == &qeth_fake_ops))
8313 goto out; 8328 goto out;
8314 8329
8315 rcu_read_lock(); 8330 rcu_read_lock();