Home
last modified time | relevance | path

Searched refs:crc (Results 1 – 25 of 100) sorted by relevance

1234

/linux-2.4.37.9/lib/
Dcrc32.c66 u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) in u32()
70 crc ^= *p++; in u32()
72 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in u32()
74 return crc; in u32()
86 u32 attribute((pure)) crc32_le(u32 crc, unsigned char const *p, size_t len) in u32()
93 # define DO_CRC(x) crc = tab[ (crc ^ (x)) & 255 ] ^ (crc>>8) in u32()
95 # define DO_CRC(x) crc = tab[ ((crc >> 24) ^ (x)) & 255] ^ (crc<<8) in u32()
98 crc = __cpu_to_le32(crc); in u32()
113 crc ^= *++b; in u32()
131 return __le32_to_cpu(crc); in u32()
[all …]
Dgen_crc32table.c23 u_int32_t crc = 1; in crc32init_le() local
28 crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY_LE : 0); in crc32init_le()
30 crc32table_le[i + j] = crc ^ crc32table_le[j]; in crc32init_le()
40 u_int32_t crc = 0x80000000; in crc32init_be() local
45 crc = (crc << 1) ^ ((crc & 0x80000000) ? CRCPOLY_BE : 0); in crc32init_be()
47 crc32table_be[i + j] = crc ^ crc32table_be[j]; in crc32init_be()
/linux-2.4.37.9/fs/udf/
Dcrc.c88 udf_crc(uint8_t *data, uint32_t size, uint16_t crc) in udf_crc() argument
91 crc = crc_table[(crc >> 8 ^ *(data++)) & 0xffU] ^ (crc << 8); in udf_crc()
93 return crc; in udf_crc()
141 unsigned long crc, poly; in main() local
158 crc = n << 8; in main()
160 if(crc & 0x8000U) in main()
161 crc = (crc << 1) ^ poly; in main()
163 crc <<= 1; in main()
164 crc &= 0xFFFFU; in main()
167 printf("0x%04xU ", crc); in main()
[all …]
/linux-2.4.37.9/arch/mips/lasat/
Dcrc32.c68 #define DO1(buf) crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
74 unsigned long crc32(unsigned long crc, const unsigned char * buf, unsigned int len) in crc32() argument
77 crc = crc ^ 0xffffffffL; in crc32()
86 return crc ^ 0xffffffffL; in crc32()
Dlasat_board.c101 unsigned long crc; in lasat_init_board_info() local
115 crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info), in lasat_init_board_info()
118 if (crc != lasat_board_info.li_eeprom_info.crc32) { in lasat_init_board_info()
271 unsigned long crc; in lasat_write_eeprom_info() local
274 crc = EEPROM_CRC((unsigned char *)(&lasat_board_info.li_eeprom_info), in lasat_write_eeprom_info()
276 lasat_board_info.li_eeprom_info.crc32 = crc; in lasat_write_eeprom_info()
/linux-2.4.37.9/fs/jffs2/
Dread.c49 __u32 crc; in jffs2_read_dnode() local
70 crc = crc32(0, ri, sizeof(*ri)-8); in jffs2_read_dnode()
72 … csize %x, offset %x, buf %p\n", fd->raw->flash_offset & ~3, ri->node_crc, crc, ri->dsize, ri->csi… in jffs2_read_dnode()
73 if (crc != ri->node_crc) { in jffs2_read_dnode()
74 …printk(KERN_WARNING "Node CRC %08x != calculated CRC %08x for node at %08x\n", ri->node_crc, crc, … in jffs2_read_dnode()
134 crc = crc32(0, readbuf, ri->csize); in jffs2_read_dnode()
135 if (crc != ri->data_crc) { in jffs2_read_dnode()
136 …printk(KERN_WARNING "Data CRC %08x != calculated CRC %08x for node at %08x\n", ri->data_crc, crc, … in jffs2_read_dnode()
140 D2(printk(KERN_DEBUG "Data CRC matches calculated CRC %08x\n", crc)); in jffs2_read_dnode()
Dscan.c430 __u32 crc; in jffs2_scan_inode_node() local
452 crc = crc32(0, &ri, sizeof(ri)-8); in jffs2_scan_inode_node()
455 if(crc != ri.node_crc) { in jffs2_scan_inode_node()
457 *ofs, ri.node_crc, crc); in jffs2_scan_inode_node()
473 __u32 crc; in jffs2_scan_inode_node() local
492 crc = crc32(0, dbuf, ri.csize); in jffs2_scan_inode_node()
494 if (crc != ri.data_crc) { in jffs2_scan_inode_node()
496 *ofs, ri.data_crc, crc); in jffs2_scan_inode_node()
608 __u32 crc; in jffs2_scan_dirent_node() local
628 crc = crc32(0, &rd, sizeof(rd)-8); in jffs2_scan_dirent_node()
[all …]
/linux-2.4.37.9/drivers/isdn/hisax/
Disdnhdlc.c120 hdlc->crc = 0; in isdnhdlc_rcv_init()
255 hdlc->crc = 0xffff; in isdnhdlc_decode()
299 } else if (hdlc->crc != 0xf0b8){ in isdnhdlc_decode()
309 hdlc->crc = 0xffff; in isdnhdlc_decode()
346 cval = (hdlc->crc^hdlc->shift_reg) & 0xff; in isdnhdlc_decode()
347 hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval]; in isdnhdlc_decode()
432 hdlc->crc ^= 0xffff; in isdnhdlc_encode()
434 hdlc->shift_reg = hdlc->crc & 0xff; in isdnhdlc_encode()
462 hdlc->crc = 0xffff; in isdnhdlc_encode()
490 hdlc->crc = 0xffff; in isdnhdlc_encode()
[all …]
Dst5481_hdlc.c75 hdlc->crc = 0; in hdlc_rcv_init()
211 hdlc->crc = 0xffff; in hdlc_decode()
255 } else if (hdlc->crc != 0xf0b8){ in hdlc_decode()
265 hdlc->crc = 0xffff; in hdlc_decode()
302 cval = (hdlc->crc^hdlc->shift_reg) & 0xff; in hdlc_decode()
303 hdlc->crc = (hdlc->crc>>8)^crc16_tab[cval]; in hdlc_decode()
388 hdlc->crc ^= 0xffff; in hdlc_encode()
390 hdlc->shift_reg = hdlc->crc & 0xff; in hdlc_encode()
418 hdlc->crc = 0xffff; in hdlc_encode()
446 hdlc->crc = 0xffff; in hdlc_encode()
[all …]
/linux-2.4.37.9/drivers/net/wan/
Dsbni.c567 u32 crc = CRC32_INITIAL; in recv_frame() local
572 if( check_fhdr( ioaddr, &framelen, &frameno, &ack, &is_first, &crc ) ) { in recv_frame()
574 ? upload_data( dev, framelen, frameno, is_first, crc ) in recv_frame()
575 : skip_tail( ioaddr, framelen, crc ); in recv_frame()
601 u32 crc = CRC32_INITIAL; in send_frame() local
622 send_frame_header( dev, &crc ); in send_frame()
631 download_data( dev, &crc ); in send_frame()
636 outsb( dev->base_addr + DAT, (u8 *)&crc, sizeof crc ); in send_frame()
673 unsigned is_first, u32 crc ) in upload_data() argument
686 frame_ok = append_frame_to_pkt( dev, framelen, crc ); in upload_data()
[all …]
Dsbni.h129 #define CRC32(c,crc) (crc32tab[((size_t)(crc) ^ (c)) & 0xff] ^ (((crc) >> 8) & 0x00FFFFFF)) argument
Dcycx_drv.c582 u16 crc = 0; in checksum() local
587 flag = (crc & 0x8000); in checksum()
588 crc <<= 1; in checksum()
589 crc |= ((*buf & mask) ? 1 : 0); in checksum()
592 crc ^= 0x1021; in checksum()
595 return crc; in checksum()
/linux-2.4.37.9/drivers/isdn/hysdn/
Dhysdn_boot.c341 u_char crc; in EvalSysrTokData() local
350 for (p = cp, crc = 0; p < (cp + len - 2); p++) in EvalSysrTokData()
351 if ((crc & 0x80)) in EvalSysrTokData()
352 crc = (((u_char) (crc << 1)) + 1) + *p; in EvalSysrTokData()
354 crc = ((u_char) (crc << 1)) + *p; in EvalSysrTokData()
355 crc = ~crc; in EvalSysrTokData()
356 if (crc != *(cp + len - 1)) { in EvalSysrTokData()
/linux-2.4.37.9/drivers/net/wan/8253x/
Dcrc32.c90 fn_calc_memory_chunk_crc32(void *p, unsigned int n_bytes, unsigned int crc) in fn_calc_memory_chunk_crc32() argument
93 unsigned int result = ~crc; in fn_calc_memory_chunk_crc32()
118 fn_check_memory_crc32(void *p, unsigned int n_bytes, unsigned int crc) in fn_check_memory_crc32() argument
120 return(fn_calc_memory_crc32(p, n_bytes) == crc); in fn_check_memory_crc32()
/linux-2.4.37.9/drivers/net/hamradio/
Dhdlcdrv.c142 unsigned int crc = 0xffff; in append_crc_ccitt() local
145 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buffer++) & 0xff]; in append_crc_ccitt()
146 crc ^= 0xffff; in append_crc_ccitt()
147 *buffer++ = crc; in append_crc_ccitt()
148 *buffer++ = crc >> 8; in append_crc_ccitt()
155 unsigned int crc = 0xffff; in check_crc_ccitt() local
158 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff]; in check_crc_ccitt()
159 return (crc & 0xffff) == 0xf0b8; in check_crc_ccitt()
167 unsigned int crc = 0xffff;
170 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff];
[all …]
Dmkiss.c125 unsigned short crc = 0xffff; in calc_crc_flex() local
128 crc = (crc << 8) ^ Crc_flex_table[((crc >> 8) ^ *cp++) & 0xff]; in calc_crc_flex()
130 return crc; in calc_crc_flex()
137 unsigned short crc = 0xffff; in check_crc_flex() local
143 crc = (crc << 8) ^ Crc_flex_table[((crc >> 8) ^ *cp++) & 0xff]; in check_crc_flex()
145 if ((crc & 0xffff) != 0x7070) in check_crc_flex()
381 unsigned short crc; in ax_encaps() local
385 crc = calc_crc_flex(p, len); in ax_encaps()
386 count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2); in ax_encaps()
775 static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc, int len) in kiss_esc_crc() argument
[all …]
Dbaycom_epp.c309 unsigned int crc = 0xffff;
312 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buffer++) & 0xff];
313 crc ^= 0xffff;
314 *buffer++ = crc;
315 *buffer++ = crc >> 8;
323 unsigned int crc = 0xffff; in check_crc_ccitt() local
326 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff]; in check_crc_ccitt()
327 return (crc & 0xffff) == 0xf0b8; in check_crc_ccitt()
334 unsigned int crc = 0xffff; in calc_crc_ccitt() local
337 crc = (crc >> 8) ^ crc_ccitt_table[(crc ^ *buf++) & 0xff]; in calc_crc_ccitt()
[all …]
/linux-2.4.37.9/include/linux/
Dcrc32.h10 extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
11 extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
/linux-2.4.37.9/drivers/net/
Dbmac.c909 unsigned int crc; in bmac_addhash() local
913 crc = bmac_crc((unsigned short *)addr) & 0x3f; /* Big-endian alert! */ in bmac_addhash()
914 crc = reverse6[crc]; /* Hyperfast bit-reversing algorithm */ in bmac_addhash()
915 if (bp->hash_use_count[crc]++) return; /* This bit is already set */ in bmac_addhash()
916 mask = crc % 16; in bmac_addhash()
918 bp->hash_use_count[crc/16] |= mask; in bmac_addhash()
924 unsigned int crc; in bmac_removehash() local
928 crc = bmac_crc((unsigned short *)addr) & 0x3f; /* Big-endian alert! */ in bmac_removehash()
929 crc = reverse6[crc]; /* Hyperfast bit-reversing algorithm */ in bmac_removehash()
930 if (bp->hash_use_count[crc] == 0) return; /* That bit wasn't in use! */ in bmac_removehash()
[all …]
/linux-2.4.37.9/drivers/bluetooth/
Dhci_bcsp.c88 static void bcsp_crc_update(u16 *crc, u8 d) in bcsp_crc_update() argument
90 u16 reg = *crc; in bcsp_crc_update()
95 *crc = reg; in bcsp_crc_update()
106 static u16 bcsp_crc_reverse(u16 crc) in bcsp_crc_reverse() argument
112 rev |= (crc & 1); in bcsp_crc_reverse()
113 crc = crc >> 1; in bcsp_crc_reverse()
/linux-2.4.37.9/arch/x86_64/boot/compressed/
Dmisc.c238 ulg c = crc; /* temporary variable */ in flush_window_low()
248 crc = c; in flush_window_low()
256 ulg c = crc; /* temporary variable */ in flush_window_high()
265 crc = c; in flush_window_high()
/linux-2.4.37.9/fs/partitions/
Defi.c339 u32 crc, origcrc; in is_gpt_valid() local
359 crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size)); in is_gpt_valid()
361 if (crc != origcrc) { in is_gpt_valid()
364 crc, origcrc); in is_gpt_valid()
388 crc = efi_crc32((const unsigned char *) (*ptes), in is_gpt_valid()
392 if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) { in is_gpt_valid()
/linux-2.4.37.9/arch/i386/boot/compressed/
Dmisc.c246 ulg c = crc; /* temporary variable */ in flush_window_low()
256 crc = c; in flush_window_low()
264 ulg c = crc; /* temporary variable */ in flush_window_high()
273 crc = c; in flush_window_high()
/linux-2.4.37.9/drivers/block/
Damiflop.c904 unsigned short crc; /* on 68000 we got an alignment problem, member
1072 unsigned short crc,data_crc[2]; in dos_read() local
1093 crc = dos_hdr_crc(&hdr); in dos_read()
1097 hdr.sec, hdr.len_desc, hdr.crc); in dos_read()
1100 if (crc != hdr.crc) { in dos_read()
1102 hdr.crc, crc); in dos_read()
1147 crc = dos_data_crc(unit[drive].trackbuf + (hdr.sec - 1) * 512); in dos_read()
1149 if (crc != data_crc[0]) { in dos_read()
1152 hdr.sec, hdr.len_desc, scnt,data_crc[0], crc); in dos_read()
1193 static ushort crc[2]={0,0x4e4e}; in ms_putsec() local
[all …]
/linux-2.4.37.9/drivers/usb/
Dspeedtch.c442 u32 crc; in udsl_groom_skb() local
466 crc = crc32_be (~0, skb->data, skb->len); in udsl_groom_skb()
467 crc = crc32_be (crc, zeros, zero_padding); in udsl_groom_skb()
468 crc = crc32_be (crc, ctrl->aal5_trailer, 4); in udsl_groom_skb()
469 crc = ~crc; in udsl_groom_skb()
471 ctrl->aal5_trailer [4] = crc >> 24; in udsl_groom_skb()
472 ctrl->aal5_trailer [5] = crc >> 16; in udsl_groom_skb()
473 ctrl->aal5_trailer [6] = crc >> 8; in udsl_groom_skb()
474 ctrl->aal5_trailer [7] = crc; in udsl_groom_skb()

1234