zd1201 - can't compile (2.6.14-gentoo-r5)

2006-03-07
2013-03-22
  • I get zd1201-0.14 and can't compile it.

    My system is Gentoo-linux:
    kernel:  Linux gentoo 2.6.14-gentoo-r5-2hlg #3 Sat Mar 4 13:43:10 2006
    gcc:     i686-pc-linux-gnu-3.4.4

    Here are two patches, that help me get working driver.

    Sorry for my english. 8)

    >>------------------

    --- zd1201-0.14/Makefile    2004-11-04 19:45:55.000000000 +0300
    +++ zd1201-0.14-patched/Makefile    2006-03-05 00:40:37.000000000 +0300
    @@ -1,3 +1,3 @@
    obj-m := zd1201.o
    # Make ieee802_11.h visible:
    -CFLAGS_zd1201.o = -Idrivers/net/wireless/
    +#CFLAGS_zd1201.o = -Idrivers/net/wireless/

    >>------------------

    >>------------------

    --- zd1201-0.14/zd1201.c    2006-03-04 11:09:23.000000000 +0300
    +++ zd1201-0.14-patched/zd1201.c    2006-03-05 01:03:57.000000000 +0300
    @@ -21,7 +21,7 @@
    #include <linux/string.h>
    #include <linux/if_arp.h>
    #include <linux/firmware.h>
    -#include <ieee802_11.h>
    +#include <net/ieee80211.h>
    #include "zd1201.h"

    static struct usb_device_id zd1201_table[] = {
    @@ -328,25 +328,25 @@
                 goto resubmit;
             }
                
    -        if ((seq & IEEE802_11_SCTL_FRAG) ||
    -            (fc & IEEE802_11_FCTL_MOREFRAGS)) {
    +        if ((seq & IEEE80211_SCTL_FRAG) ||
    +            (fc & IEEE80211_FCTL_MOREFRAGS)) {
                 struct zd1201_frag *frag=NULL;
                 char *ptr;
                 printk(KERN_DEBUG "defrag len: %x fc: %x seq: %x\n",
                     len, fc, seq);
                 if (datalen<14)
                     goto resubmit;
    -            if ((seq & IEEE802_11_SCTL_FRAG) == 0) {
    +            if ((seq & IEEE80211_SCTL_FRAG) == 0) {
                     if ((frag=kmalloc(sizeof(struct zd1201_frag*),
                         GFP_ATOMIC))==NULL)
                         goto resubmit;
                     if (!(skb=dev_alloc_skb(
    -                    IEEE802_11_DATA_LEN + 14 +2))) {
    +                    IEEE80211_DATA_LEN + 14 +2))) {
                         kfree(frag);
                         goto resubmit;
                     }
                     frag->skb=skb;
    -                frag->seq=seq & IEEE802_11_SCTL_SEQ;
    +                frag->seq=seq & IEEE80211_SCTL_SEQ;
                     skb_reserve(skb, 2);
                     memcpy(skb_put(skb, 12), &data[datalen-14], 12);
                     memcpy(skb_put(skb, 2), &data[6], 2);
    @@ -355,7 +355,7 @@
                     goto resubmit;
                 }
                 hlist_for_each_entry(frag, node, &zd->fraglist, fnode)
    -                if(frag->seq==(seq&IEEE802_11_SCTL_SEQ))
    +                if(frag->seq==(seq & IEEE80211_SCTL_SEQ))
                         break;
                 if (!frag)
                     goto resubmit;
    @@ -363,7 +363,7 @@
                 ptr=skb_put(skb, len);
                 if (ptr)
                     memcpy(ptr, data+8, len);
    -            if (fc & IEEE802_11_FCTL_MOREFRAGS)
    +            if (fc & IEEE80211_FCTL_MOREFRAGS)
                     goto resubmit;
                 hlist_del_init(&frag->fnode);
                 kfree(frag);
    @@ -806,7 +806,8 @@
         if (!zd)
             return;
         printk(KERN_INFO "%s: TX timeout, shooting down urb\n", dev->name);
    -    zd->tx_urb.transfer_flags |= URB_ASYNC_UNLINK;
    +                                   // commented because of...
    +    zd->tx_urb.transfer_flags; // |= URB_ASYNC_UNLINK;
         usb_unlink_urb(&zd->tx_urb);
         zd->stats.tx_errors++;

    >>------------------

     
    • Andres Ederra
      Andres Ederra
      2006-03-07

      Thanx for the patch.

      But as today this driver has been merged into the main 2.6 linux branch.

      As part of the merger several patches have been applyed, for instance a patch equivalent to this one you post.

      TOdyas better option to use this driver is to use it as part of the kernel.

      You can find it at the Drivers/USB/Networking/zd1201 section on your kernel configuration.

      You will need the firmware provided at this project anyway.

      Greets

      Andrés

       
    • 8)