s390: qeth driver fixes
Subsystems (4)
PATCH 2/5 s390: qeth driver fixes
[PATCH 2/5] s390: qeth driver fixes
From: Frank Blaschka <[email protected]>
- packet socket support is not complete.
Recvfrom a packet socket does not fill the sockaddr_ll structure. device function hard_header_parse is not implemented. For layer 2 mode and layer 3 mode with fake_ll turned on, we have the information to fill sockaddr_ll.
Signed-off-by Frank Pavlic <[email protected]>
--- drivers/s390/net/qeth_main.c | 58 ++++++++++++++++++++++++++++++++++++++---- 1 files changed, 53 insertions(+), 5 deletions(-)
drivers/s390/net/qeth_main.c +53 -5
@@ -3953,13 +3953,22 @@ static inline struct sk_buff * qeth_prepare_skb(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr **hdr, int ipv) { - struct sk_buff *new_skb; + struct sk_buff *new_skb, *new_skb2;QETH_DBF_TEXT (trace,6 ,"prepskb" ); - - new_skb =qeth_realloc_headroom (card, skb,sizeof (struct qeth_hdr )); -if (new_skb ==NULL ) + new_skb = skb; + new_skb =qeth_pskb_unshare (skb,GFP_ATOMIC ); +if (!new_skb)return NULL ; + new_skb2 =qeth_realloc_headroom (card, new_skb, +sizeof (struct qeth_hdr )); +if (!new_skb2) { +__qeth_free_new_skb (skb, new_skb); +return NULL ; + } +if (new_skb != skb) +__qeth_free_new_skb (new_skb2, new_skb); + new_skb = new_skb2; *hdr =__qeth_prepare_skb (card, new_skb, ipv);if (*hdr ==NULL ) {__qeth_free_new_skb (skb, new_skb);
@@ -6336,6 +6345,42 @@ static struct ethtool_ops qeth_ethtool_o };static int +qeth_hard_header_parse (struct sk_buff *skb,unsigned char *haddr) +{ +struct qeth_card *card; +struct ethhdr *eth; + + card =qeth_get_card_from_dev (skb->dev); +if (card->options.layer2) + goto haveheader; +#ifdef CONFIG_QETH_IPV6 +/* cause of the manipulated arp constructor and the ARP +flag for OSAE devices we have some nasty exceptions */ +if (card->info.type ==QETH_CARD_TYPE_OSAE ) { +if (!card->options.fake_ll) { +if ((skb->pkt_type==PACKET_OUTGOING ) && + (skb->protocol==ETH_P_IPV6 )) + goto haveheader; +else +return 0 ; + }else { +if ((skb->pkt_type==PACKET_OUTGOING ) && + (skb->protocol==ETH_P_IP )) +return 0 ; +else + goto haveheader; + } + } +#endif +if (!card->options.fake_ll) +return 0 ; +haveheader: + eth =eth_hdr (skb); +memcpy (haddr, eth->h_source,ETH_ALEN ); +return ETH_ALEN ; +} + +static int qeth_netdev_init (struct net_device *dev) {struct qeth_card *card;
@@ -6373,7 +6418,10 @@ #endifif (card->options.fake_ll && (qeth_get_netdev_flags (card) &IFF_NOARP )) dev->hard_header = qeth_fake_header; - dev->hard_header_parse =NULL ; +if (dev->type ==ARPHRD_IEEE802_TR ) + dev->hard_header_parse =NULL ; +else + dev->hard_header_parse = qeth_hard_header_parse; dev->set_mac_address = qeth_layer2_set_mac_address; dev->flags |=qeth_get_netdev_flags (card); if ((card->options.fake_broadcast) ||
Signature · 1 line
1.4.2.3