diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-24 21:15:13 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-24 21:15:13 +0400 |
commit | a319a2773a13bab56a0d0b3744ba8703324313b5 (patch) | |
tree | f02c86acabd1031439fd422a167784007e84ebb1 /drivers/net/bsd_comp.c | |
parent | e18fa700c9a31360bc8f193aa543b7ef7b39a06b (diff) | |
parent | 183798799216fad36c7219fe8d4d6dee6b8fa755 (diff) | |
download | linux-a319a2773a13bab56a0d0b3744ba8703324313b5.tar.xz |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (217 commits)
net/ieee80211: fix more crypto-related build breakage
[PATCH] Spidernet: add ethtool -S (show statistics)
[NET] GT96100: Delete bitrotting ethernet driver
[PATCH] mv643xx_eth: restrict to 32-bit PPC_MULTIPLATFORM
[PATCH] Cirrus Logic ep93xx ethernet driver
r8169: the MMIO region of the 8167 stands behin BAR#1
e1000, ixgb: Remove pointless wrappers
[PATCH] Remove powerpc specific parts of 3c509 driver
[PATCH] s2io: Switch to pci_get_device
[PATCH] gt96100: move to pci_get_device API
[PATCH] ehea: bugfix for register access functions
[PATCH] e1000 disable device on PCI error
drivers/net/phy/fixed: #if 0 some incomplete code
drivers/net: const-ify ethtool_ops declarations
[PATCH] ethtool: allow const ethtool_ops
[PATCH] sky2: big endian
[PATCH] sky2: fiber support
[PATCH] sky2: tx pause bug fix
drivers/net: Trim trailing whitespace
[PATCH] ehea: IBM eHEA Ethernet Device Driver
...
Manually resolved conflicts in drivers/net/ixgb/ixgb_main.c and
drivers/net/sky2.c related to CHECKSUM_HW/CHECKSUM_PARTIAL changes by
commit 84fa7933a33f806bbbaae6775e87459b1ec584c0 that just happened to be
next to unrelated changes in this update.
Diffstat (limited to 'drivers/net/bsd_comp.c')
-rw-r--r-- | drivers/net/bsd_comp.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c index fb4098ed469e..bae1de1e7802 100644 --- a/drivers/net/bsd_comp.c +++ b/drivers/net/bsd_comp.c @@ -1,5 +1,5 @@ /* - * Update: The Berkeley copyright was changed, and the change + * Update: The Berkeley copyright was changed, and the change * is retroactive to all "true" BSD software (ie everything * from UCB as opposed to other peoples code that just carried * the same license). The new copyright doesn't clash with the @@ -256,9 +256,9 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */ db->in_count -= (db->in_count >> 2); db->bytes_out -= (db->bytes_out >> 2); } - + db->checkpoint = db->in_count + CHECK_GAP; - + if (db->max_ent >= db->maxmaxcode) { /* Reset the dictionary only if the ratio is worse, @@ -274,7 +274,7 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */ { new_ratio /= db->bytes_out; } - + if (new_ratio < db->ratio || new_ratio < 1 * RATIO_SCALE) { bsd_clear (db); @@ -293,7 +293,7 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */ static void bsd_comp_stats (void *state, struct compstat *stats) { struct bsd_db *db = (struct bsd_db *) state; - + stats->unc_bytes = db->uncomp_bytes; stats->unc_packets = db->uncomp_count; stats->comp_bytes = db->comp_bytes; @@ -325,7 +325,7 @@ static void bsd_reset (void *state) static void bsd_free (void *state) { struct bsd_db *db = state; - + if (!db) return; @@ -468,7 +468,7 @@ static int bsd_init (void *state, unsigned char *options, { struct bsd_db *db = state; int indx; - + if ((opt_len != 3) || (options[0] != CI_BSD_COMPRESS) || (options[1] != 3) || (BSD_VERSION(options[2]) != BSD_CURRENT_VERSION) || (BSD_NBITS(options[2]) != db->maxbits) @@ -500,9 +500,9 @@ static int bsd_init (void *state, unsigned char *options, if (debug) #endif db->debug = 1; - + bsd_reset(db); - + return 1; } @@ -660,7 +660,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf, fcode = BSD_KEY (ent, c); hval = BSD_HASH (ent, c, hshift); dictp = dict_ptr (db, hval); - + /* Validate and then check the entry. */ if (dictp->codem1 >= max_ent) { @@ -672,7 +672,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf, ent = dictp->codem1 + 1; continue; /* found (prefix,suffix) */ } - + /* continue probing until a match or invalid entry */ disp = (hval == 0) ? 1 : hval; @@ -693,10 +693,10 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf, ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */ continue; - + nomatch: OUTPUT(ent); /* output the prefix */ - + /* code -> hashtable */ if (max_ent < db->maxmaxcode) { @@ -710,7 +710,7 @@ nomatch: db->n_bits = ++n_bits; mxcode = MAXCODE (n_bits); } - + /* Invalidate old hash table entry using * this code, and then take it over. */ @@ -738,7 +738,7 @@ nomatch: } ent = c; } - + OUTPUT(ent); /* output the last code */ db->bytes_out += olen - PPP_HDRLEN - BSD_OVHD; @@ -760,7 +760,7 @@ nomatch: { OUTPUT (CLEAR); } - + /* * Pad dribble bits of last code with ones. * Do not emit a completely useless byte of ones. @@ -770,7 +770,7 @@ nomatch: { PUTBYTE((accm | (0xff << (bitno-8))) >> 24); } - + /* * Increase code size if we would have without the packet * boundary because the decompressor will do so. @@ -856,7 +856,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, bitno = 32; /* 1st valid bit in accm */ n_bits = db->n_bits; tgtbitno = 32 - n_bits; /* bitno when we have a code */ - + /* * Save the address/control from the PPP header * and then get the sequence number. @@ -869,7 +869,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, ibuf += (PPP_HDRLEN + 2); ilen = isize - (PPP_HDRLEN + 2); - + /* * Check the sequence number and give up if it differs from * the value we're expecting. @@ -897,7 +897,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, *wptr++ = adrs; *wptr++ = ctrl; *wptr++ = 0; - + oldcode = CLEAR; explen = 3; @@ -934,7 +934,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, /* * The dictionary must only be cleared at the end of a packet. */ - + if (incode == CLEAR) { if (ilen > 0) @@ -945,7 +945,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, } return DECOMP_FATALERROR; /* probably a bug */ } - + bsd_clear(db); break; } @@ -962,7 +962,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, } return DECOMP_FATALERROR; /* probably a bug */ } - + /* Special case for KwKwK string. */ if (incode > max_ent) { @@ -974,7 +974,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, finchar = incode; extra = 0; } - + codelen = *(lens_ptr (db, finchar)); explen += codelen + extra; if (explen > osize) @@ -989,7 +989,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, } return DECOMP_FATALERROR; } - + /* * Decode this code and install it in the decompressed buffer. */ @@ -999,7 +999,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, while (finchar > LAST) { struct bsd_dict *dictp2 = dict_ptr (db, finchar); - + dictp = dict_ptr (db, dictp2->cptr); #ifdef DEBUG if (--codelen <= 0 || dictp->codem1 != finchar-1) @@ -1029,7 +1029,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, finchar = dictp->f.hs.prefix; } *--p = finchar; - + #ifdef DEBUG if (--codelen != 0) { @@ -1037,12 +1037,12 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, db->unit, codelen, incode, max_ent); } #endif - + if (extra) /* the KwKwK case again */ { *wptr++ = finchar; } - + /* * If not first code in a packet, and * if not out of code space, then allocate a new code. @@ -1057,11 +1057,11 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, unsigned short *lens1, *lens2; unsigned long fcode; int hval, disp, indx; - + fcode = BSD_KEY(oldcode,finchar); hval = BSD_HASH(oldcode,finchar,db->hshift); dictp = dict_ptr (db, hval); - + /* look for a free hash table entry */ if (dictp->codem1 < max_ent) { @@ -1077,7 +1077,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, } while (dictp->codem1 < max_ent); } - + /* * Invalidate previous hash table entry * assigned this code, and then take it over @@ -1101,7 +1101,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, lens1 = lens_ptr (db, max_ent); lens2 = lens_ptr (db, oldcode); *lens1 = *lens2 + 1; - + /* Expand code size if needed. */ if (max_ent >= MAXCODE(n_bits) && max_ent < db->maxmaxcode) { @@ -1127,7 +1127,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize, } return explen; } - + /************************************************************* * Table of addresses for the BSD compression module *************************************************************/ |