• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/net/

Lines Matching refs:state

62 static void	z_comp_free(void *state);
63 static void z_decomp_free(void *state);
64 static int z_comp_init(void *state, unsigned char *options,
67 static int z_decomp_init(void *state, unsigned char *options,
70 static int z_compress(void *state, unsigned char *rptr,
73 static void z_incomp(void *state, unsigned char *ibuf, int icnt);
74 static int z_decompress(void *state, unsigned char *ibuf,
76 static void z_comp_reset(void *state);
77 static void z_decomp_reset(void *state);
78 static void z_comp_stats(void *state, struct compstat *stats);
82 * @arg: pointer to the private state for the compressor.
86 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
88 if (state) {
89 zlib_deflateEnd(&state->strm);
90 vfree(state->strm.workspace);
91 kfree(state);
106 * Returns the pointer to the private state for the compressor,
111 struct ppp_deflate_state *state;
124 state = kmalloc(sizeof(*state),
126 if (state == NULL)
129 memset (state, 0, sizeof (struct ppp_deflate_state));
130 state->strm.next_in = NULL;
131 state->w_size = w_size;
132 state->strm.workspace = vmalloc(zlib_deflate_workspacesize());
133 if (state->strm.workspace == NULL)
136 if (zlib_deflateInit2(&state->strm, Z_DEFAULT_COMPRESSION,
140 return (void *) state;
143 z_comp_free(state);
149 * @arg: pointer to the private state for the compressor
165 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
171 || DEFLATE_SIZE(options[2]) != state->w_size
175 state->seqno = 0;
176 state->unit = unit;
177 state->debug = debug;
179 zlib_deflateReset(&state->strm);
186 * @arg: pointer to private state for the compressor.
193 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
195 state->seqno = 0;
196 zlib_deflateReset(&state->strm);
201 * @arg: pointer to private state for the compressor
213 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
239 wptr[0] = state->seqno >> 8;
240 wptr[1] = state->seqno;
243 state->strm.next_out = wptr;
244 state->strm.avail_out = oavail = osize - olen;
245 ++state->seqno;
249 state->strm.next_in = rptr;
250 state->strm.avail_in = (isize - off);
253 r = zlib_deflate(&state->strm, Z_PACKET_FLUSH);
255 if (state->debug)
260 if (state->strm.avail_out == 0) {
262 state->strm.next_out = NULL;
263 state->strm.avail_out = oavail = 1000000;
268 olen += oavail - state->strm.avail_out;
274 state->stats.comp_bytes += olen;
275 state->stats.comp_packets++;
277 state->stats.inc_bytes += isize;
278 state->stats.inc_packets++;
281 state->stats.unc_bytes += isize;
282 state->stats.unc_packets++;
295 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
297 *stats = state->stats;
306 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
308 if (state) {
309 zlib_inflateEnd(&state->strm);
310 kfree(state->strm.workspace);
311 kfree(state);
326 * Returns the pointer to the private state for the decompressor,
331 struct ppp_deflate_state *state;
344 state = kmalloc(sizeof(*state), GFP_KERNEL);
345 if (state == NULL)
348 memset (state, 0, sizeof (struct ppp_deflate_state));
349 state->w_size = w_size;
350 state->strm.next_out = NULL;
351 state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
353 if (state->strm.workspace == NULL)
356 if (zlib_inflateInit2(&state->strm, -w_size) != Z_OK)
358 return (void *) state;
361 z_decomp_free(state);
367 * @arg: pointer to the private state for the decompressor
384 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
390 || DEFLATE_SIZE(options[2]) != state->w_size
394 state->seqno = 0;
395 state->unit = unit;
396 state->debug = debug;
397 state->mru = mru;
399 zlib_inflateReset(&state->strm);
406 * @arg: pointer to private state for the decompressor.
413 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
415 state->seqno = 0;
416 zlib_inflateReset(&state->strm);
421 * @arg: pointer to private state for the decompressor
443 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
449 if (state->debug)
451 state->unit, isize);
457 if (seq != (state->seqno & 0xffff)) {
458 if (state->debug)
460 state->unit, seq, state->seqno & 0xffff);
463 ++state->seqno;
478 state->strm.next_in = ibuf + PPP_HDRLEN + DEFLATE_OVHD;
479 state->strm.avail_in = isize - (PPP_HDRLEN + DEFLATE_OVHD);
480 state->strm.next_out = obuf + 3;
481 state->strm.avail_out = 1;
489 r = zlib_inflate(&state->strm, Z_PACKET_FLUSH);
491 if (state->debug)
493 state->unit, r, (state->strm.msg? state->strm.msg: ""));
496 if (state->strm.avail_out != 0)
499 state->strm.avail_out = osize - PPP_HDRLEN;
503 --state->strm.next_out;
504 ++state->strm.avail_out;
513 state->strm.next_out = overflow_buf;
514 state->strm.avail_out = 1;
517 if (state->debug)
519 state->unit);
525 if (state->debug)
527 state->unit);
531 olen = osize + overflow - state->strm.avail_out;
532 state->stats.unc_bytes += olen;
533 state->stats.unc_packets++;
534 state->stats.comp_bytes += isize;
535 state->stats.comp_packets++;
542 * @arg: pointer to private state for the decompressor
548 struct ppp_deflate_state *state = (struct ppp_deflate_state *) arg;
558 ++state->seqno;
564 state->strm.next_in = ibuf + 3;
565 state->strm.avail_in = icnt - 3;
567 --state->strm.next_in;
568 ++state->strm.avail_in;
571 r = zlib_inflateIncomp(&state->strm);
574 if (state->debug) {
576 state->unit, r, (state->strm.msg? state->strm.msg: ""));
584 state->stats.inc_bytes += icnt;
585 state->stats.inc_packets++;
586 state->stats.unc_bytes += icnt;
587 state->stats.unc_packets++;