ChangeSet 1.1043.1.5, 2003/02/16 09:38:32-08:00, duncan.sands@math.u-psud.fr [PATCH] USB speedtouch: expose crc defs to speedtouch Expose some CRC definitions in atmsar.h (for use by speedtouch.c). diff -Nru a/drivers/usb/misc/atmsar.c b/drivers/usb/misc/atmsar.c --- a/drivers/usb/misc/atmsar.c Tue Feb 18 16:43:07 2003 +++ b/drivers/usb/misc/atmsar.c Tue Feb 18 16:43:07 2003 @@ -119,7 +119,6 @@ */ #define CRC32_REMAINDER CBF43926 #define CRC32_INITIAL 0xffffffff -#define CRC32(c,crc) (crc32tab[((size_t)(crc>>24) ^ (c)) & 0xff] ^ (((crc) << 8))) unsigned long crc32tab[256] = { 0x00000000L, 0x04C11DB7L, 0x09823B6EL, 0x0D4326D9L, 0x130476DCL, 0x17C56B6BL, 0x1A864DB2L, 0x1E475005L, @@ -213,8 +212,6 @@ return (crc); } #endif - -#define crc32( crc, mem, len) calc_crc(mem, len, crc); /* initialization routines. not used at the moment * I will avoid these as long as possible !! diff -Nru a/drivers/usb/misc/atmsar.h b/drivers/usb/misc/atmsar.h --- a/drivers/usb/misc/atmsar.h Tue Feb 18 16:43:07 2003 +++ b/drivers/usb/misc/atmsar.h Tue Feb 18 16:43:07 2003 @@ -50,6 +50,11 @@ #define ATMSAR_DEF_MTU_AAL34 0 /* not supported */ #define ATMSAR_DEF_MTU_AAL5 65535 /* max mtu .. */ +#define CRC32(c,crc) (crc32tab[((size_t)(crc>>24) ^ (c)) & 0xff] ^ (((crc) << 8))) +#define crc32( crc, mem, len) calc_crc(mem, len, crc); + +extern unsigned long crc32tab[256]; + struct atmsar_vcc_data { struct atmsar_vcc_data *next; @@ -91,5 +96,7 @@ struct sk_buff *atmsar_alloc_tx (struct atmsar_vcc_data *vcc, unsigned int size); unsigned int atmsar_encode (struct atmsar_vcc_data *ctx, char *source, char *target, unsigned int pdu_length); + +unsigned long calc_crc (char *mem, int len, unsigned initial); #endif /* _ATMSAR_H_ */