Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d36c16eb032239cb038ad875ecf83c545002461
Commit:     2d36c16eb032239cb038ad875ecf83c545002461
Parent:     95c78c8bfe8d0b49a43f392b9a74e2f9e89765ab
Author:     Frank Blaschka <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 8 17:29:58 2007 +0100
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Jan 9 02:18:32 2007 -0500

    s390: qeth driver fixes: packet socket
    
        - 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]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/s390/net/qeth_main.c |   58 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 015dc4c..bfc37ba 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -3952,13 +3952,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);
@@ -6339,6 +6348,42 @@ static struct ethtool_ops qeth_ethtool_ops = {
 };
 
 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;
@@ -6376,7 +6421,10 @@ qeth_netdev_init(struct net_device *dev)
        if (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) ||
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to