Lines Matching refs:comp
97 struct slcompress *comp; in slhc_init() local
100 comp = (struct slcompress *)kmalloc(sizeof(struct slcompress), in slhc_init()
102 if (! comp) in slhc_init()
104 memset(comp, 0, sizeof(struct slcompress)); in slhc_init()
108 comp->rstate = (struct cstate *) kmalloc(rsize, GFP_KERNEL); in slhc_init()
109 if (! comp->rstate) in slhc_init()
111 memset(comp->rstate, 0, rsize); in slhc_init()
112 comp->rslot_limit = rslots - 1; in slhc_init()
117 comp->tstate = (struct cstate *) kmalloc(tsize, GFP_KERNEL); in slhc_init()
118 if (! comp->tstate) in slhc_init()
120 memset(comp->tstate, 0, tsize); in slhc_init()
121 comp->tslot_limit = tslots - 1; in slhc_init()
124 comp->xmit_oldest = 0; in slhc_init()
125 comp->xmit_current = 255; in slhc_init()
126 comp->recv_current = 255; in slhc_init()
133 comp->flags |= SLF_TOSS; in slhc_init()
136 ts = comp->tstate; in slhc_init()
137 for(i = comp->tslot_limit; i > 0; --i){ in slhc_init()
141 ts[0].next = &(ts[comp->tslot_limit]); in slhc_init()
144 return comp; in slhc_init()
147 kfree((unsigned char *)comp->rstate); in slhc_init()
149 kfree((unsigned char *)comp); in slhc_init()
158 slhc_free(struct slcompress *comp) in slhc_free() argument
160 if ( comp == NULLSLCOMPR ) in slhc_free()
163 if ( comp->tstate != NULLSLSTATE ) in slhc_free()
164 kfree( comp->tstate ); in slhc_free()
166 if ( comp->rstate != NULLSLSTATE ) in slhc_free()
167 kfree( comp->rstate ); in slhc_free()
169 kfree( comp ); in slhc_free()
232 slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, in slhc_compress() argument
235 register struct cstate *ocs = &(comp->tstate[comp->xmit_oldest]); in slhc_compress()
260 comp->sls_o_nontcp++; in slhc_compress()
262 comp->sls_o_tcp++; in slhc_compress()
277 comp->sls_o_tcp++; in slhc_compress()
306 comp->sls_o_searches++; in slhc_compress()
317 comp->sls_o_misses++; in slhc_compress()
318 comp->xmit_oldest = lcs->cs_this; in slhc_compress()
329 comp->xmit_oldest = lcs->cs_this; in slhc_compress()
450 if(compress_cid == 0 || comp->xmit_current != cs->cs_this){ in slhc_compress()
455 comp->xmit_current = cs->cs_this; in slhc_compress()
465 comp->sls_o_compressed++; in slhc_compress()
480 comp->xmit_current = cs->cs_this; in slhc_compress()
481 comp->sls_o_uncompressed++; in slhc_compress()
491 slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize) in slhc_uncompress() argument
502 comp->sls_i_compressed++; in slhc_uncompress()
504 comp->sls_i_error++; in slhc_uncompress()
513 if(x < 0 || x > comp->rslot_limit) in slhc_uncompress()
516 comp->flags &=~ SLF_TOSS; in slhc_uncompress()
517 comp->recv_current = x; in slhc_uncompress()
522 if(comp->flags & SLF_TOSS){ in slhc_uncompress()
523 comp->sls_i_tossed++; in slhc_uncompress()
527 cs = &comp->rstate[comp->recv_current]; in slhc_uncompress()
634 comp->sls_i_error++; in slhc_uncompress()
635 return slhc_toss( comp ); in slhc_uncompress()
640 slhc_remember(struct slcompress *comp, unsigned char *icp, int isize) in slhc_remember() argument
649 comp->sls_i_runt++; in slhc_remember()
650 return slhc_toss( comp ); in slhc_remember()
656 comp->sls_i_runt++; in slhc_remember()
657 return slhc_toss( comp ); in slhc_remember()
664 comp->sls_i_badcheck++; in slhc_remember()
665 return slhc_toss( comp ); in slhc_remember()
667 if(index > comp->rslot_limit) { in slhc_remember()
668 comp->sls_i_error++; in slhc_remember()
669 return slhc_toss(comp); in slhc_remember()
673 cs = &comp->rstate[comp->recv_current = index]; in slhc_remember()
674 comp->flags &=~ SLF_TOSS; in slhc_remember()
685 comp->sls_i_uncompressed++; in slhc_remember()
691 slhc_toss(struct slcompress *comp) in slhc_toss() argument
693 if ( comp == NULLSLCOMPR ) in slhc_toss()
696 comp->flags |= SLF_TOSS; in slhc_toss()
701 void slhc_i_status(struct slcompress *comp) in slhc_i_status() argument
703 if (comp != NULLSLCOMPR) { in slhc_i_status()
705 comp->sls_i_compressed, in slhc_i_status()
706 comp->sls_i_uncompressed, in slhc_i_status()
707 comp->sls_i_error, in slhc_i_status()
708 comp->sls_i_tossed); in slhc_i_status()
713 void slhc_o_status(struct slcompress *comp) in slhc_o_status() argument
715 if (comp != NULLSLCOMPR) { in slhc_o_status()
717 comp->sls_o_compressed, in slhc_o_status()
718 comp->sls_o_uncompressed, in slhc_o_status()
719 comp->sls_o_tcp, in slhc_o_status()
720 comp->sls_o_nontcp); in slhc_o_status()
722 comp->sls_o_searches, in slhc_o_status()
723 comp->sls_o_misses); in slhc_o_status()
754 slhc_toss(struct slcompress *comp) in slhc_toss() argument
760 slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize) in slhc_uncompress() argument
766 slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, in slhc_compress() argument
774 slhc_remember(struct slcompress *comp, unsigned char *icp, int isize) in slhc_remember() argument
781 slhc_free(struct slcompress *comp) in slhc_free() argument