> Date: Tue, 11 Oct 2016 23:03:59 +0200
> From: Frederic Cambus <f...@statdns.com>
> 
> On Fri, Oct 07, 2016 at 06:02:35PM +0200, Mark Kettenis wrote:
> 
> > > It seems there are still some leftovers from the zaurus port removal.
> > > 
> > > Comments? OK?
> > 
> > Not ok.  This is support for the zaurus as a usb device attached to an
> 
> My mistake, thanks for the clarification.
> 
> > OpenBSD machine.  Perhaps the option should be renamed (to CDCE_CRC32
> > for example) to make this clear.
> 
> That would make sense, what about the following diff?

Makes sesne to me. ok kettenis@

> Index: sys/dev/usb/if_cdce.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/if_cdce.c,v
> retrieving revision 1.71
> diff -u -p -r1.71 if_cdce.c
> --- sys/dev/usb/if_cdce.c     26 Sep 2016 07:09:32 -0000      1.71
> +++ sys/dev/usb/if_cdce.c     11 Oct 2016 10:37:53 -0000
> @@ -93,13 +93,13 @@ static uint32_t    cdce_crc32(const void *
>  const struct cdce_type cdce_devs[] = {
>      {{ USB_VENDOR_ACERLABS, USB_PRODUCT_ACERLABS_M5632 }, 0 },
>      {{ USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2501 }, 0 },
> -    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5500 }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_A300 }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5600 }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C700 }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C750 }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN }, CDCE_ZAURUS },
> -    {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2 }, CDCE_ZAURUS },
> +    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5500 }, CDCE_CRC32 },
> +    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_A300 }, CDCE_CRC32 },
> +    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_SL5600 }, CDCE_CRC32 },
> +    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C700 }, CDCE_CRC32 },
> +    {{ USB_VENDOR_SHARP, USB_PRODUCT_SHARP_C750 }, CDCE_CRC32 },
> +    {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN }, CDCE_CRC32 },
> +    {{ USB_VENDOR_MOTOROLA2, USB_PRODUCT_MOTOROLA2_USBLAN2 }, CDCE_CRC32 },
>      {{ USB_VENDOR_GMATE, USB_PRODUCT_GMATE_YP3X00 }, 0 },
>      {{ USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_ETHERNETGADGET }, 0 },
>      {{ USB_VENDOR_COMPAQ, USB_PRODUCT_COMPAQ_IPAQLINUX }, 0 },
> @@ -409,8 +409,8 @@ cdce_encap(struct cdce_softc *sc, struct
>       c = &sc->cdce_cdata.cdce_tx_chain[idx];
>  
>       m_copydata(m, 0, m->m_pkthdr.len, c->cdce_buf);
> -     if (sc->cdce_flags & CDCE_ZAURUS) {
> -             /* Zaurus wants a 32-bit CRC appended to every frame */
> +     if (sc->cdce_flags & CDCE_CRC32) {
> +             /* Some devices want a 32-bit CRC appended to every frame */
>               u_int32_t crc;
>  
>               crc = cdce_crc32(c->cdce_buf, m->m_pkthdr.len);
> @@ -741,8 +741,8 @@ cdce_rxeof(struct usbd_xfer *xfer, void 
>       sc->cdce_rxeof_errors = 0;
>  
>       usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
> -     if (sc->cdce_flags & CDCE_ZAURUS)
> -             total_len -= 4; /* Strip off CRC added by Zaurus */
> +     if (sc->cdce_flags & CDCE_CRC32)
> +             total_len -= 4; /* Strip off added CRC */
>       if (total_len <= 1)
>               goto done;
>  
> Index: sys/dev/usb/if_cdcereg.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/if_cdcereg.h,v
> retrieving revision 1.6
> diff -u -p -r1.6 if_cdcereg.h
> --- sys/dev/usb/if_cdcereg.h  4 Dec 2013 00:52:52 -0000       1.6
> +++ sys/dev/usb/if_cdcereg.h  11 Oct 2016 10:37:53 -0000
> @@ -41,7 +41,7 @@
>  struct cdce_type {
>       struct usb_devno         cdce_dev;
>       u_int16_t                cdce_flags;
> -#define CDCE_ZAURUS  1
> +#define CDCE_CRC32   1
>  #define CDCE_SWAPUNION       2
>  };
>  
> 

Reply via email to