summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
Commit message (Expand)AuthorAgeFilesLines
* - string changes: perl -pi -e 's!Can not!Cannot!'Ahmad Samir2011-04-041-1/+1
* - import stage1/drakxtools arm supportArnaud Patard2011-03-181-1/+13
* - import stage1/drakxtools mips supportArnaud Patard2011-03-181-1/+33
* - use EVIOCGBIT ioctl instead of trying to parse key field fromArnaud Patard2011-03-181-2/+7
* - try to parse DMI informations only on x86 to avoid reading/writing some randomArnaud Patard2011-03-181-1/+6
* Synthesized commit during git-svn import combining previous Mandriva history ...Mageia SVN-Git Migration2011-02-061-1/+1
* detect "Rack Mount" Chassis as serverOlivier Blin2010-03-301-1/+1
* Add ThinkServer to known serversChristophe Fergeau2010-03-011-1/+1
* - detect_devices:Olivier Blin2010-02-231-1/+1
* no more need to forward declare %hd_vendors (basically revertingThierry Vignaud2010-01-181-2/+2
* (_get_hd_vendor) detect "Hitachi" vendor for more hard discsThierry Vignaud2010-01-181-0/+1
* (_get_hd_vendor) factorize code (needed for next commit)Thierry Vignaud2010-01-181-7/+14
* perl_checker cleanupsThierry Vignaud2010-01-181-3/+3
* detect "Maxtor" vendor for hard discsThierry Vignaud2010-01-181-0/+1
* rename %eide_hds as %hd_vendors since it better document what it isThierry Vignaud2010-01-181-6/+6
* (getSCSI) guess real vendor names like we use to do for IDE devices for yearsThierry Vignaud2010-01-181-0/+4
* forward declare %eide_hds (needed for next commit)Thierry Vignaud2010-01-181-2/+2
* (getSCSI) factorize vendor & model extractionThierry Vignaud2010-01-181-2/+3
* (complete_usb_storage_info) fix retrieving empty info for USB discsThierry Vignaud2010-01-181-1/+2
* fix detecting pcmcia serial devicesOlivier Blin2010-01-051-2/+2
* update drakx to get proper sysfs device path from usb devicesHerton Ronaldo Krzesinski2009-11-251-2/+2
* fix SCSI driver module nameOlivier Blin2009-11-241-1/+2
* fix reading USB details (#55690)Olivier Blin2009-11-241-1/+1
* fix get_sysfs_usbpath_for_block and callersOlivier Blin2009-11-241-5/+5
* (pci_probe) better check for PCI Express capabilityThierry Vignaud2009-09-301-10/+3
* add missing bit that got lost between euphor and mdv (fixing runningThierry Vignaud2009-09-231-0/+1
* reduce perl_checker's SNR ratioThierry Vignaud2009-09-231-0/+1
* (is_child_of_a_pcie_bridge) introduce itThierry Vignaud2009-09-231-2/+15
* (get_pci_sysfs_path) extract it out of pci_probe__real() (needed forThierry Vignaud2009-09-231-1/+7
* perl_checker cleanupsThierry Vignaud2009-09-231-5/+5
* revert bogus bit in latest commtiThierry Vignaud2009-09-231-1/+1
* (pci_probe__real,c::pci_probe) retrieve PCI revision (#42576)Thierry Vignaud2009-09-231-2/+2
* fix VirtIO devices support and release 12.46Pascal Terjan2009-08-281-2/+1
* (dmidecode) fix parsing dmidecode output (broken since we useThierry Vignaud2009-08-111-1/+4
* don't log the links we ignore when looking for scsi devices (#49406)Pascal Terjan2009-07-091-1/+1
* move serialPort function from mouse.pm to detect_devices.pmChristophe Fergeau2009-07-011-1/+6
* do not ignore FB-DIMM memoryPascal Terjan2009-05-271-1/+1
* Add 'touchpad' type to rpmsrateChristophe Fergeau2009-05-041-0/+1
* Add detect_devices::hasTouchpad() functionChristophe Fergeau2009-05-041-0/+2
* Detect Elantech touchpadChristophe Fergeau2009-05-041-0/+1
* handle virtio block devicesPascal Terjan2009-04-231-1/+9
* (getModem) enable to skip (slow) detecting serial modemsThierry Vignaud2009-04-161-1/+2
* detect_devices: only look at valid scsi devices in /sysPascal Terjan2009-03-221-1/+3
* (is_vmware) add infrastucture for detecting vmwareThierry Vignaud2009-03-201-0/+4
* Try to detect serversPascal Terjan2009-01-091-0/+12
* fix previous commit (thanks to titi)Pascal Rigaux2008-10-201-1/+1
* - fix detecting SMP (was broken we relied on install kernel being non-smp) (#...Pascal Rigaux2008-10-201-0/+1
* do not detect pan* devices as ethernet devices for nowOlivier Blin2008-10-021-1/+2
* allow detection of low resources systems (extracted from compssUsers.pl) and ...Olivier Blin2008-10-021-0/+14
* fix input devices detection in rpmsrate (broken for 3 years, #43721)Olivier Blin2008-09-101-1/+1
/span> *stats = state->stats; stats->ratio = stats->unc_bytes; out = stats->comp_bytes + stats->unc_bytes; if (stats->ratio <= 0x7ffffff) stats->ratio <<= 8; else out >>= 8; if (out != 0) stats->ratio /= out; } /* * Allocate space for a decompressor. */ static void * z_decomp_alloc(options, opt_len) u_char *options; int opt_len; { struct deflate_state *state; int w_size; if (opt_len != CILEN_DEFLATE || options[0] != CI_DEFLATE || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || options[3] != DEFLATE_CHK_SEQUENCE) return NULL; w_size = DEFLATE_SIZE(options[2]); if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) return NULL; state = (struct deflate_state *) malloc(sizeof(*state)); if (state == NULL) return NULL; state->strm.next_out = NULL; state->strm.zalloc = (alloc_func) z_alloc; state->strm.zfree = (free_func) z_free; if (inflateInit2(&state->strm, -w_size) != Z_OK) { free(state); return NULL; } state->w_size = w_size; memset(&state->stats, 0, sizeof(state->stats)); return (void *) state; } static void z_decomp_free(arg) void *arg; { struct deflate_state *state = (struct deflate_state *) arg; inflateEnd(&state->strm); free(state); } static int z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug) void *arg; u_char *options; int opt_len, unit, hdrlen, mru, debug; { struct deflate_state *state = (struct deflate_state *) arg; if (opt_len < CILEN_DEFLATE || options[0] != CI_DEFLATE || options[1] != CILEN_DEFLATE || DEFLATE_METHOD(options[2]) != DEFLATE_METHOD_VAL || DEFLATE_SIZE(options[2]) != state->w_size || options[3] != DEFLATE_CHK_SEQUENCE) return 0; state->seqno = 0; state->unit = unit; state->hdrlen = hdrlen; state->debug = debug; state->mru = mru; inflateReset(&state->strm); return 1; } static void z_decomp_reset(arg) void *arg; { struct deflate_state *state = (struct deflate_state *) arg; state->seqno = 0; inflateReset(&state->strm); } /* * Decompress a Deflate-compressed packet. * * Because of patent problems, we return DECOMP_ERROR for errors * found by inspecting the input data and for system problems, but * DECOMP_FATALERROR for any errors which could possibly be said to * be being detected "after" decompression. For DECOMP_ERROR, * we can issue a CCP reset-request; for DECOMP_FATALERROR, we may be * infringing a patent of Motorola's if we do, so we take CCP down * instead. * * Given that the frame has the correct sequence number and a good FCS, * errors such as invalid codes in the input most likely indicate a * bug, so we return DECOMP_FATALERROR for them in order to turn off * compression, even though they are detected by inspecting the input. */ static int z_decompress(arg, mi, inlen, mo, outlenp) void *arg; u_char *mi, *mo; int inlen, *outlenp; { struct deflate_state *state = (struct deflate_state *) arg; u_char *rptr, *wptr; int rlen, olen, ospace; int seq, i, flush, r, decode_proto; rptr = mi; if (*rptr == 0) ++rptr; ++rptr; /* Check the sequence number. */ seq = (rptr[0] << 8) + rptr[1]; rptr += 2; if (seq != state->seqno) { #if !DEFLATE_DEBUG if (state->debug) #endif printf("z_decompress%d: bad seq # %d, expected %d\n", state->unit, seq, state->seqno); return DECOMP_ERROR; } ++state->seqno; /* * Set up to call inflate. */ wptr = mo; state->strm.next_in = rptr; state->strm.avail_in = mi + inlen - rptr; rlen = state->strm.avail_in + PPP_HDRLEN + DEFLATE_OVHD; state->strm.next_out = wptr; state->strm.avail_out = state->mru + 2; r = inflate(&state->strm, Z_PACKET_FLUSH); if (r != Z_OK) { #if !DEFLATE_DEBUG if (state->debug) #endif printf("z_decompress%d: inflate returned %d (%s)\n", state->unit, r, (state->strm.msg? state->strm.msg: "")); return DECOMP_FATALERROR; } olen = state->mru + 2 - state->strm.avail_out; *outlenp = olen; if ((wptr[0] & 1) != 0) ++olen; /* for suppressed protocol high byte */ olen += 2; /* for address, control */ #if DEFLATE_DEBUG if (olen > state->mru + PPP_HDRLEN) printf("ppp_deflate%d: exceeded mru (%d > %d)\n", state->unit, olen, state->mru + PPP_HDRLEN); #endif state->stats.unc_bytes += olen; state->stats.unc_packets++; state->stats.comp_bytes += rlen; state->stats.comp_packets++; return DECOMP_OK; } /* * Incompressible data has arrived - add it to the history. */ static void z_incomp(arg, mi, mlen) void *arg; u_char *mi; int mlen; { struct deflate_state *state = (struct deflate_state *) arg; u_char *rptr; int rlen, proto, r; /* * Check that the protocol is one we handle. */ rptr = mi; proto = rptr[0]; if ((proto & 1) == 0) proto = (proto << 8) + rptr[1]; if (proto > 0x3fff || proto == 0xfd || proto == 0xfb) return; ++state->seqno; if (rptr[0] == 0) ++rptr; rlen = mi + mlen - rptr; state->strm.next_in = rptr; state->strm.avail_in = rlen; r = inflateIncomp(&state->strm); if (r != Z_OK) { /* gak! */ #if !DEFLATE_DEBUG if (state->debug) #endif printf("z_incomp%d: inflateIncomp returned %d (%s)\n", state->unit, r, (state->strm.msg? state->strm.msg: "")); return; } /* * Update stats. */ if (proto <= 0xff) ++rlen; rlen += 2; state->stats.inc_bytes += rlen; state->stats.inc_packets++; state->stats.unc_bytes += rlen; state->stats.unc_packets++; } #endif /* DO_DEFLATE */