*BSD News Article 55831


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!newsfeed.internetmci.com!uwm.edu!daffy!uwvax!newssinet!news.nc.u-tokyo.ac.jp!wnoc-tyo-news!spinnews!spin-hsd0-tky!okigw!tyo-hub!okics!primera!usenet
From: yokoi@hard2.takasaki.oki.co.jp (Eiji Yokoi)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Multicast support in the 3COM 3C509B (ep0) driver?
Date: 1 Dec 1995 08:09:45 GMT
Organization: Oki Electric Industry Co., Ltd.
Lines: 173
Message-ID: <49md89$3up@primera.hard1.takasaki.oki.co.jp>
References: <finlayson-1811950121040001@hokianga.live.com>
NNTP-Posting-Host: gop.hard2.takasaki.oki.co.jp
X-Newsreader: WinVN 0.92.6J

In article <finlayson-1811950121040001@hokianga.live.com>, finlayson@live.com (Ross Finlayson) says:
>Is there a good reason for this?  Is there a version of this driver code
>out there that handles multicast?  If not, could I likely get the driver
>to work by copying appropriate code from the if_ed.c driver (which, unlike
>if_ep.c, *does* seem to support multicast)?

Next patch have been posted to fj.os.bsd.freebsd(fj meens From Japan).
by Mr. Nakagawa <y-nakaga@ccs.mt.nec.co.jp>
The message ID is <Y-NAKAGA.95Oct26163023@spls63.ccs.mt.nec.co.jp>.
Original article was wrote in Japanese, so I will post only part
of the patch. He said that ep0 looks like works well, but use it by
your own risk.
Good luck!
--- from here ---
*** if_ep.c.org Wed Sep 20 16:31:24 1995
--- if_ep.c     Thu Sep 21 14:40:13 1995
***************
*** 423,429 ****
      ifp->if_unit = is->id_unit;
      ifp->if_name = "ep";
      ifp->if_mtu = ETHERMTU;
!     ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS;
      ifp->if_init = epinit;
      ifp->if_output = ether_output;
      ifp->if_start = epstart;
--- 423,430 ----
      ifp->if_unit = is->id_unit;
      ifp->if_name = "ep";
      ifp->if_mtu = ETHERMTU;
!     ifp->if_flags =
!       IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
      ifp->if_init = epinit;
      ifp->if_output = ether_output;
      ifp->if_start = epstart;
***************
*** 1200,1205 ****
--- 1201,1223 ----
            }
  
        break;
+ 
+       case SIOCADDMULTI:
+       case SIOCDELMULTI:
+               error = (cmd == SIOCADDMULTI) ?
+                   ether_addmulti(ifr, &sc->arpcom) :
+                   ether_delmulti(ifr, &sc->arpcom);
+ 
+               if (error == ENETRESET) {
+                       /*
+                        * Multicast list has changed; set the hardware filter
+                        * accordingly.
+                        */
+                       epinit(ifp->if_unit);
+                       error = 0;
+               }
+               break;
+ 
  #ifdef notdef
        case SIOCGHWADDR:
        bcopy((caddr_t) sc->sc_addr, (caddr_t) & ifr->ifr_data,

*** if_zp.c.org Thu Sep 21 14:23:44 1995
--- if_zp.c     Thu Sep 21 15:00:51 1995
***************
*** 912,918 ****
      sc->attached = 1;
  
  #else /* MACH_KERNEL */
!     ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS;
      ifp->if_unit = isa_dev->id_unit;
      ifp->if_name = "zp";
      ifp->if_init = zpinit;
--- 912,919 ----
      sc->attached = 1;
  
  #else /* MACH_KERNEL */
!     ifp->if_flags =
!       IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
      ifp->if_unit = isa_dev->id_unit;
      ifp->if_name = "zp";
      ifp->if_init = zpinit;
***************
*** 1987,1992 ****
--- 1988,2010 ----
        if (ifp->if_flags & IFF_UP && (ifp->if_flags & IFF_RUNNING) == 0)
            zpinit(ifp->if_unit);
        break;
+ 
+     case SIOCADDMULTI:
+     case SIOCDELMULTI:
+       error = (cmd == SIOCADDMULTI) ?
+           ether_addmulti(ifr, &sc->arpcom) :
+           ether_delmulti(ifr, &sc->arpcom);
+ 
+       if (error == ENETRESET) {
+               /*
+                * Multicast list has changed; set the hardware filter
+                * accordingly.
+                */
+               zpinit(ifp->if_unit);
+               error = 0;
+       }
+       break;
+ 
  #ifdef notdef
      case SIOCGHWADDR:
        bcopy((caddr_t) sc->sc_addr, (caddr_t) & ifr->ifr_data,

*** if_tun.c.org        Thu Sep 21 17:19:49 1995
--- if_tun.c    Thu Sep 21 19:02:18 1995
***************
*** 108,114 ****
                ifp->if_mtu = TUNMTU;
                ifp->if_ioctl = tunifioctl;
                ifp->if_output = tunoutput;
!               ifp->if_flags = IFF_POINTOPOINT;
                ifp->if_snd.ifq_maxlen = ifqmaxlen;
                ifp->if_collisions = 0;
                ifp->if_ierrors = 0;
--- 108,114 ----
                ifp->if_mtu = TUNMTU;
                ifp->if_ioctl = tunifioctl;
                ifp->if_output = tunoutput;
!               ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
                ifp->if_snd.ifq_maxlen = ifqmaxlen;
                ifp->if_collisions = 0;
                ifp->if_ierrors = 0;
***************
*** 238,243 ****
--- 238,244 ----
        int     cmd;
        caddr_t data;
  {
+       register struct ifreq *ifr = (struct ifreq *)data;
        struct tun_softc *tp = &tunctl[ifp->if_unit];
        int             error = 0, s;
  
***************
*** 253,258 ****
--- 254,279 ----
                TUNDEBUG("%s%d: destination address set\n",
                         ifp->if_name, ifp->if_unit);
                break;
+ 
+       case SIOCADDMULTI:
+       case SIOCDELMULTI:
+               if (ifr == 0) {
+                       error = EAFNOSUPPORT;           /* XXX */
+                       break;
+               }
+               switch (ifr->ifr_addr.sa_family) {
+ 
+ #ifdef INET
+               case AF_INET:
+                       break;
+ #endif
+ 
+               default:
+                       error = EAFNOSUPPORT;
+                       break;
+               }
+               break;
+ 
        default:
                error = EINVAL;
        }

--
-- 
        $BF|K\EE5$3t<02q<R(B $B%M%C%H%o!<%-%s%05;=Q8&5f=j(B $B%$%s%?%M%C%H5;=QIt(B
                $BCf@n(B $B9%5W(B       y-nakaga@ccs.mt.nec.co.jp
                                jj3mxl@eatell.msr.prug.or.jp