taglinefilesource code
db196drivers/net/bsd_comp.cstatic int  bsd_init        (void *db, unsigned char *options,
db245drivers/net/bsd_comp.cbsd_clear(struct bsd_db *db)
db247drivers/net/bsd_comp.cdb->clear_count++;
db248drivers/net/bsd_comp.cdb->max_ent      = FIRST-1;
db249drivers/net/bsd_comp.cdb->n_bits       = BSD_INIT_BITS;
db250drivers/net/bsd_comp.cdb->bytes_out    = 0;
db251drivers/net/bsd_comp.cdb->in_count     = 0;
db252drivers/net/bsd_comp.cdb->incomp_count = 0;
db253drivers/net/bsd_comp.cdb->ratio       = 0;
db254drivers/net/bsd_comp.cdb->checkpoint   = CHECK_GAP;
db271drivers/net/bsd_comp.cstatic int bsd_check (struct bsd_db *db)  /* 1=output CLEAR */
db275drivers/net/bsd_comp.cif (db->in_count >= db->checkpoint)
db278drivers/net/bsd_comp.cif (db->in_count >= RATIO_MAX || db->bytes_out >= RATIO_MAX)
db280drivers/net/bsd_comp.cdb->in_count  -= (db->in_count  >> 2);
db281drivers/net/bsd_comp.cdb->bytes_out -= (db->bytes_out >> 2);
db284drivers/net/bsd_comp.cdb->checkpoint = db->in_count + CHECK_GAP;
db286drivers/net/bsd_comp.cif (db->max_ent >= db->maxmaxcode)
db296drivers/net/bsd_comp.cnew_ratio = db->in_count << RATIO_SCALE_LOG;
db297drivers/net/bsd_comp.cif (db->bytes_out != 0)
db299drivers/net/bsd_comp.cnew_ratio /= db->bytes_out;
db302drivers/net/bsd_comp.cif (new_ratio < db->ratio || new_ratio < 1 * RATIO_SCALE)
db304drivers/net/bsd_comp.cbsd_clear (db);
db307drivers/net/bsd_comp.cdb->ratio = new_ratio;
db319drivers/net/bsd_comp.cstruct bsd_db *db = (struct bsd_db *) state;
db321drivers/net/bsd_comp.cstats->unc_bytes    = db->uncomp_bytes;
db322drivers/net/bsd_comp.cstats->unc_packets  = db->uncomp_count;
db323drivers/net/bsd_comp.cstats->comp_bytes   = db->comp_bytes;
db324drivers/net/bsd_comp.cstats->comp_packets = db->comp_count;
db325drivers/net/bsd_comp.cstats->inc_bytes    = db->incomp_bytes;
db326drivers/net/bsd_comp.cstats->inc_packets  = db->incomp_count;
db327drivers/net/bsd_comp.cstats->in_count     = db->in_count;
db328drivers/net/bsd_comp.cstats->bytes_out    = db->bytes_out;
db337drivers/net/bsd_comp.cstruct bsd_db *db = (struct bsd_db *) state;
db339drivers/net/bsd_comp.cbsd_clear(db);
db341drivers/net/bsd_comp.cdb->seqno       = 0;
db342drivers/net/bsd_comp.cdb->clear_count = 0;
db351drivers/net/bsd_comp.cstruct bsd_db *db = (struct bsd_db *) state;
db353drivers/net/bsd_comp.cif (db)
db358drivers/net/bsd_comp.cif (db->dict)
db360drivers/net/bsd_comp.cvfree (db->dict);
db361drivers/net/bsd_comp.cdb->dict = NULL;
db366drivers/net/bsd_comp.cif (db->lens)
db368drivers/net/bsd_comp.cvfree (db->lens);
db369drivers/net/bsd_comp.cdb->lens = NULL;
db374drivers/net/bsd_comp.ckfree (db);
db387drivers/net/bsd_comp.cstruct bsd_db *db;
db429drivers/net/bsd_comp.cdb         = (struct bsd_db *) kmalloc (sizeof (struct bsd_db),
db431drivers/net/bsd_comp.cif (!db)
db436drivers/net/bsd_comp.cmemset (db, 0, sizeof(struct bsd_db));
db441drivers/net/bsd_comp.cdb->dict = (struct bsd_dict *) vmalloc (hsize *
db443drivers/net/bsd_comp.cif (!db->dict)
db445drivers/net/bsd_comp.cbsd_free (db);
db455drivers/net/bsd_comp.cdb->lens = NULL;
db462drivers/net/bsd_comp.cdb->lens = (unsigned short *) vmalloc ((maxmaxcode + 1) *
db463drivers/net/bsd_comp.csizeof (db->lens[0]));
db464drivers/net/bsd_comp.cif (!db->lens)
db466drivers/net/bsd_comp.cbsd_free (db);
db473drivers/net/bsd_comp.cdb->totlen     = sizeof (struct bsd_db)   +
db476drivers/net/bsd_comp.cdb->hsize      = hsize;
db477drivers/net/bsd_comp.cdb->hshift     = hshift;
db478drivers/net/bsd_comp.cdb->maxmaxcode = maxmaxcode;
db479drivers/net/bsd_comp.cdb->maxbits    = bits;
db481drivers/net/bsd_comp.creturn (void *) db;
db501drivers/net/bsd_comp.cstruct bsd_db *db = state;
db506drivers/net/bsd_comp.c|| (BSD_NBITS(options[2]) != db->maxbits)
db507drivers/net/bsd_comp.c|| (decomp && db->lens == NULL))
db517drivers/net/bsd_comp.cdb->lens[indx] = 1;
db522drivers/net/bsd_comp.cindx = db->hsize;
db525drivers/net/bsd_comp.cdb->dict[indx].codem1 = BADCODEM1;
db526drivers/net/bsd_comp.cdb->dict[indx].cptr   = 0;
db529drivers/net/bsd_comp.cdb->unit = unit;
db530drivers/net/bsd_comp.cdb->mru  = 0;
db534drivers/net/bsd_comp.cdb->debug = 1;
db536drivers/net/bsd_comp.cbsd_reset(db);
db562drivers/net/bsd_comp.cstatic unsigned short *lens_ptr(struct bsd_db *db, int idx)
db564drivers/net/bsd_comp.cif ((unsigned int) idx > (unsigned int) db->maxmaxcode)
db569drivers/net/bsd_comp.creturn lens_ptrx (db, idx);
db572drivers/net/bsd_comp.cstatic struct bsd_dict *dict_ptr(struct bsd_db *db, int idx)
db574drivers/net/bsd_comp.cif ((unsigned int) idx >= (unsigned int) db->hsize)
db579drivers/net/bsd_comp.creturn dict_ptrx (db, idx);
db583drivers/net/bsd_comp.c#define lens_ptr(db,idx) lens_ptrx(db,idx)
db584drivers/net/bsd_comp.c#define dict_ptr(db,idx) dict_ptrx(db,idx)
db601drivers/net/bsd_comp.cstruct bsd_db *db;
db656drivers/net/bsd_comp.cdb      = (struct bsd_db *) state;
db657drivers/net/bsd_comp.chshift  = db->hshift;
db658drivers/net/bsd_comp.cmax_ent = db->max_ent;
db659drivers/net/bsd_comp.cn_bits  = db->n_bits;
db680drivers/net/bsd_comp.c*wptr++ = db->seqno >> 8;
db681drivers/net/bsd_comp.c*wptr++ = db->seqno;
db694drivers/net/bsd_comp.cdictp = dict_ptr (db, hval);
db714drivers/net/bsd_comp.cif (hval >= db->hsize)
db716drivers/net/bsd_comp.chval -= db->hsize;
db718drivers/net/bsd_comp.cdictp = dict_ptr (db, hval);
db733drivers/net/bsd_comp.cif (max_ent < db->maxmaxcode)
db742drivers/net/bsd_comp.cdb->n_bits = ++n_bits;
db750drivers/net/bsd_comp.cdictp2 = dict_ptr (db, max_ent + 1);
db752drivers/net/bsd_comp.cdictp3 = dict_ptr (db, indx);
db762drivers/net/bsd_comp.cdb->max_ent    = ++max_ent;
db764drivers/net/bsd_comp.cif (db->lens)
db766drivers/net/bsd_comp.cunsigned short *len1 = lens_ptr (db, max_ent);
db767drivers/net/bsd_comp.cunsigned short *len2 = lens_ptr (db, ent);
db776drivers/net/bsd_comp.cdb->bytes_out    += olen;  /* Do not count bytes from here */
db777drivers/net/bsd_comp.cdb->uncomp_bytes += isize;
db778drivers/net/bsd_comp.cdb->in_count     += isize;
db779drivers/net/bsd_comp.c++db->uncomp_count;
db780drivers/net/bsd_comp.c++db->seqno;
db784drivers/net/bsd_comp.c++db->bytes_out; /* must be set before calling bsd_check */
db791drivers/net/bsd_comp.cif (bsd_check(db))
db811drivers/net/bsd_comp.cif (max_ent >= mxcode && max_ent < db->maxmaxcode)
db813drivers/net/bsd_comp.cdb->n_bits++;
db819drivers/net/bsd_comp.c++db->incomp_count;
db820drivers/net/bsd_comp.cdb->incomp_bytes += isize;
db825drivers/net/bsd_comp.c++db->comp_count;
db826drivers/net/bsd_comp.cdb->comp_bytes += olen;
db865drivers/net/bsd_comp.cstruct bsd_db *db;
db885drivers/net/bsd_comp.cdb       = (struct bsd_db *) state;
db886drivers/net/bsd_comp.cmax_ent  = db->max_ent;
db889drivers/net/bsd_comp.cn_bits   = db->n_bits;
db910drivers/net/bsd_comp.cif (seq != db->seqno)
db912drivers/net/bsd_comp.cif (db->debug)
db915drivers/net/bsd_comp.cdb->unit, seq, db->seqno - 1);
db920drivers/net/bsd_comp.c++db->seqno;
db921drivers/net/bsd_comp.cdb->bytes_out += ilen;
db945drivers/net/bsd_comp.cdb->in_count += (explen - 3); /* don't count the header */
db974drivers/net/bsd_comp.cif (db->debug)
db976drivers/net/bsd_comp.cprintk("bsd_decomp%d: bad CLEAR\n", db->unit);
db981drivers/net/bsd_comp.cbsd_clear(db);
db985drivers/net/bsd_comp.cif ((incode > max_ent + 2) || (incode > db->maxmaxcode)
db988drivers/net/bsd_comp.cif (db->debug)
db991drivers/net/bsd_comp.cdb->unit, incode, oldcode);
db993drivers/net/bsd_comp.cmax_ent, explen, db->seqno);
db1010drivers/net/bsd_comp.ccodelen = *(lens_ptr (db, finchar));
db1014drivers/net/bsd_comp.cif (db->debug)
db1016drivers/net/bsd_comp.cprintk("bsd_decomp%d: ran out of mru\n", db->unit);
db1033drivers/net/bsd_comp.cstruct bsd_dict *dictp2 = dict_ptr (db, finchar);
db1035drivers/net/bsd_comp.cdictp = dict_ptr (db, dictp2->cptr);
db1041drivers/net/bsd_comp.cprintk("bsd_decomp%d: fell off end of chain ", db->unit);
db1051drivers/net/bsd_comp.cdb->unit, incode, finchar);
db1069drivers/net/bsd_comp.cdb->unit, codelen, incode, max_ent);
db1086drivers/net/bsd_comp.cif (oldcode != CLEAR && max_ent < db->maxmaxcode)
db1094drivers/net/bsd_comp.chval  = BSD_HASH(oldcode,finchar,db->hshift);
db1095drivers/net/bsd_comp.cdictp = dict_ptr (db, hval);
db1104drivers/net/bsd_comp.cif (hval >= db->hsize)
db1106drivers/net/bsd_comp.chval -= db->hsize;
db1108drivers/net/bsd_comp.cdictp = dict_ptr (db, hval);
db1118drivers/net/bsd_comp.cdictp2 = dict_ptr (db, max_ent + 1);
db1120drivers/net/bsd_comp.cdictp3 = dict_ptr (db, indx);
db1130drivers/net/bsd_comp.cdb->max_ent    = ++max_ent;
db1133drivers/net/bsd_comp.clens1  = lens_ptr (db, max_ent);
db1134drivers/net/bsd_comp.clens2  = lens_ptr (db, oldcode);
db1138drivers/net/bsd_comp.cif (max_ent >= MAXCODE(n_bits) && max_ent < db->maxmaxcode)
db1140drivers/net/bsd_comp.cdb->n_bits = ++n_bits;
db1147drivers/net/bsd_comp.c++db->comp_count;
db1148drivers/net/bsd_comp.c++db->uncomp_count;
db1149drivers/net/bsd_comp.cdb->comp_bytes   += isize - BSD_OVHD - PPP_HDRLEN;
db1150drivers/net/bsd_comp.cdb->uncomp_bytes += explen;
db1152drivers/net/bsd_comp.cif (bsd_check(db))
db1154drivers/net/bsd_comp.cif (db->debug)
db1157drivers/net/bsd_comp.cdb->unit, db->seqno - 1);