sync with OpenBSD -current
This commit is contained in:
parent
aaa686b79e
commit
1093aeaee4
25 changed files with 7769 additions and 280 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: lhash.c,v 1.26 2024/06/22 16:38:31 jsing Exp $ */
|
/* $OpenBSD: lhash.c,v 1.27 2024/06/30 14:13:08 jsing Exp $ */
|
||||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -80,7 +80,6 @@ expand(_LHASH *lh)
|
||||||
unsigned long hash, nni;
|
unsigned long hash, nni;
|
||||||
|
|
||||||
lh->num_nodes++;
|
lh->num_nodes++;
|
||||||
lh->num_expands++;
|
|
||||||
p = (int)lh->p++;
|
p = (int)lh->p++;
|
||||||
n1 = &(lh->b[p]);
|
n1 = &(lh->b[p]);
|
||||||
n2 = &(lh->b[p + (int)lh->pmax]);
|
n2 = &(lh->b[p + (int)lh->pmax]);
|
||||||
|
@ -92,7 +91,6 @@ expand(_LHASH *lh)
|
||||||
hash = np->hash;
|
hash = np->hash;
|
||||||
#else
|
#else
|
||||||
hash = lh->hash(np->data);
|
hash = lh->hash(np->data);
|
||||||
lh->num_hash_calls++;
|
|
||||||
#endif
|
#endif
|
||||||
if ((hash % nni) != p) { /* move it */
|
if ((hash % nni) != p) { /* move it */
|
||||||
*n1 = (*n1)->next;
|
*n1 = (*n1)->next;
|
||||||
|
@ -117,7 +115,6 @@ expand(_LHASH *lh)
|
||||||
n[i] = NULL; /* 02/03/92 eay */
|
n[i] = NULL; /* 02/03/92 eay */
|
||||||
lh->pmax = lh->num_alloc_nodes;
|
lh->pmax = lh->num_alloc_nodes;
|
||||||
lh->num_alloc_nodes = j;
|
lh->num_alloc_nodes = j;
|
||||||
lh->num_expand_reallocs++;
|
|
||||||
lh->p = 0;
|
lh->p = 0;
|
||||||
lh->b = n;
|
lh->b = n;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +134,6 @@ contract(_LHASH *lh)
|
||||||
lh->error++;
|
lh->error++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lh->num_contract_reallocs++;
|
|
||||||
lh->num_alloc_nodes /= 2;
|
lh->num_alloc_nodes /= 2;
|
||||||
lh->pmax /= 2;
|
lh->pmax /= 2;
|
||||||
lh->p = lh->pmax - 1;
|
lh->p = lh->pmax - 1;
|
||||||
|
@ -146,7 +142,6 @@ contract(_LHASH *lh)
|
||||||
lh->p--;
|
lh->p--;
|
||||||
|
|
||||||
lh->num_nodes--;
|
lh->num_nodes--;
|
||||||
lh->num_contracts++;
|
|
||||||
|
|
||||||
n1 = lh->b[(int)lh->p];
|
n1 = lh->b[(int)lh->p];
|
||||||
if (n1 == NULL)
|
if (n1 == NULL)
|
||||||
|
@ -166,7 +161,6 @@ getrn(_LHASH *lh, const void *data, unsigned long *rhash)
|
||||||
LHASH_COMP_FN_TYPE cf;
|
LHASH_COMP_FN_TYPE cf;
|
||||||
|
|
||||||
hash = (*(lh->hash))(data);
|
hash = (*(lh->hash))(data);
|
||||||
lh->num_hash_calls++;
|
|
||||||
*rhash = hash;
|
*rhash = hash;
|
||||||
|
|
||||||
nn = hash % lh->pmax;
|
nn = hash % lh->pmax;
|
||||||
|
@ -177,13 +171,11 @@ getrn(_LHASH *lh, const void *data, unsigned long *rhash)
|
||||||
ret = &(lh->b[(int)nn]);
|
ret = &(lh->b[(int)nn]);
|
||||||
for (n1 = *ret; n1 != NULL; n1 = n1->next) {
|
for (n1 = *ret; n1 != NULL; n1 = n1->next) {
|
||||||
#ifndef OPENSSL_NO_HASH_COMP
|
#ifndef OPENSSL_NO_HASH_COMP
|
||||||
lh->num_hash_comps++;
|
|
||||||
if (n1->hash != hash) {
|
if (n1->hash != hash) {
|
||||||
ret = &(n1->next);
|
ret = &(n1->next);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
lh->num_comp_calls++;
|
|
||||||
if (cf(n1->data, data) == 0)
|
if (cf(n1->data, data) == 0)
|
||||||
break;
|
break;
|
||||||
ret = &(n1->next);
|
ret = &(n1->next);
|
||||||
|
@ -268,14 +260,12 @@ lh_insert(_LHASH *lh, void *data)
|
||||||
#endif
|
#endif
|
||||||
*rn = nn;
|
*rn = nn;
|
||||||
ret = NULL;
|
ret = NULL;
|
||||||
lh->num_insert++;
|
|
||||||
lh->num_items++;
|
lh->num_items++;
|
||||||
}
|
}
|
||||||
else /* replace same key */
|
else /* replace same key */
|
||||||
{
|
{
|
||||||
ret = (*rn)->data;
|
ret = (*rn)->data;
|
||||||
(*rn)->data = data;
|
(*rn)->data = data;
|
||||||
lh->num_replace++;
|
|
||||||
}
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
@ -292,14 +282,12 @@ lh_delete(_LHASH *lh, const void *data)
|
||||||
rn = getrn(lh, data, &hash);
|
rn = getrn(lh, data, &hash);
|
||||||
|
|
||||||
if (*rn == NULL) {
|
if (*rn == NULL) {
|
||||||
lh->num_no_delete++;
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
} else {
|
} else {
|
||||||
nn= *rn;
|
nn= *rn;
|
||||||
*rn = nn->next;
|
*rn = nn->next;
|
||||||
ret = nn->data;
|
ret = nn->data;
|
||||||
free(nn);
|
free(nn);
|
||||||
lh->num_delete++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lh->num_items--;
|
lh->num_items--;
|
||||||
|
@ -322,11 +310,9 @@ lh_retrieve(_LHASH *lh, const void *data)
|
||||||
rn = getrn(lh, data, &hash);
|
rn = getrn(lh, data, &hash);
|
||||||
|
|
||||||
if (*rn == NULL) {
|
if (*rn == NULL) {
|
||||||
lh->num_retrieve_miss++;
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
} else {
|
} else {
|
||||||
ret = (*rn)->data;
|
ret = (*rn)->data;
|
||||||
lh->num_retrieve++;
|
|
||||||
}
|
}
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: lhash_local.h,v 1.1 2024/03/02 11:11:11 tb Exp $ */
|
/* $OpenBSD: lhash_local.h,v 1.2 2024/06/30 14:13:08 jsing Exp $ */
|
||||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -85,20 +85,6 @@ struct lhash_st {
|
||||||
unsigned long down_load; /* load times 256 */
|
unsigned long down_load; /* load times 256 */
|
||||||
unsigned long num_items;
|
unsigned long num_items;
|
||||||
|
|
||||||
unsigned long num_expands;
|
|
||||||
unsigned long num_expand_reallocs;
|
|
||||||
unsigned long num_contracts;
|
|
||||||
unsigned long num_contract_reallocs;
|
|
||||||
unsigned long num_hash_calls;
|
|
||||||
unsigned long num_comp_calls;
|
|
||||||
unsigned long num_insert;
|
|
||||||
unsigned long num_replace;
|
|
||||||
unsigned long num_delete;
|
|
||||||
unsigned long num_no_delete;
|
|
||||||
unsigned long num_retrieve;
|
|
||||||
unsigned long num_retrieve_miss;
|
|
||||||
unsigned long num_hash_comps;
|
|
||||||
|
|
||||||
int error;
|
int error;
|
||||||
} /* _LHASH */;
|
} /* _LHASH */;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: radius.h,v 1.6 2024/06/29 07:19:18 yasuoka Exp $ */
|
/* $OpenBSD: radius.h,v 1.7 2024/06/29 11:50:31 yasuoka Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009 Internet Initiative Japan Inc.
|
* Copyright (c) 2009 Internet Initiative Japan Inc.
|
||||||
|
@ -45,10 +45,10 @@
|
||||||
|
|
||||||
#define RADIUS_CODE_DISCONNECT_REQUEST 40
|
#define RADIUS_CODE_DISCONNECT_REQUEST 40
|
||||||
#define RADIUS_CODE_DISCONNECT_ACK 41
|
#define RADIUS_CODE_DISCONNECT_ACK 41
|
||||||
#define RADIUS_CODE_DISCONNECT_NACK 42
|
#define RADIUS_CODE_DISCONNECT_NAK 42
|
||||||
#define RADIUS_CODE_COA_REQUEST 43
|
#define RADIUS_CODE_COA_REQUEST 43
|
||||||
#define RADIUS_CODE_COA_ACK 44
|
#define RADIUS_CODE_COA_ACK 44
|
||||||
#define RADIUS_CODE_COA_NACK 45
|
#define RADIUS_CODE_COA_NAK 45
|
||||||
|
|
||||||
/* RADIUS attributes */
|
/* RADIUS attributes */
|
||||||
#define RADIUS_TYPE_USER_NAME 1
|
#define RADIUS_TYPE_USER_NAME 1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.\" $OpenBSD: compress.3,v 1.28 2024/05/28 13:42:06 tb Exp $
|
.\" $OpenBSD: compress.3,v 1.29 2024/06/29 16:10:08 tb Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
.\" Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
|
||||||
.\"
|
.\"
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
.\" Converted to mdoc format for the OpenBSD project
|
.\" Converted to mdoc format for the OpenBSD project
|
||||||
.\" by Jason McIntyre <jmc@openbsd.org>
|
.\" by Jason McIntyre <jmc@openbsd.org>
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: May 28 2024 $
|
.Dd $Mdocdate: June 29 2024 $
|
||||||
.Dt COMPRESS 3
|
.Dt COMPRESS 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -1148,7 +1148,7 @@ The degree of string matching from most to none is:
|
||||||
.Dv Z_FILTERED ,
|
.Dv Z_FILTERED ,
|
||||||
.Dv Z_RLE ,
|
.Dv Z_RLE ,
|
||||||
then
|
then
|
||||||
.Dv Z_HUFFMAN .
|
.Dv Z_HUFFMAN_ONLY .
|
||||||
The
|
The
|
||||||
.Fa strategy
|
.Fa strategy
|
||||||
parameter affects the compression ratio but never the correctness of the
|
parameter affects the compression ratio but never the correctness of the
|
||||||
|
|
|
@ -305,9 +305,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid block type";
|
strm->msg = (z_const char *)"invalid block type";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
}
|
}
|
||||||
|
@ -320,9 +320,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid stored block lengths";
|
strm->msg = (z_const char *)"invalid stored block lengths";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -362,9 +362,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"too many length or distance symbols";
|
strm->msg = (z_const char *)"too many length or distance symbols";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -388,9 +388,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code lengths set";
|
strm->msg = (z_const char *)"invalid code lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -415,9 +415,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -442,9 +442,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -460,9 +460,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
/* check for end-of-block code (better have one) */
|
/* check for end-of-block code (better have one) */
|
||||||
if (state->lens[256] == 0) {
|
if (state->lens[256] == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code -- missing end-of-block";
|
strm->msg = (z_const char *)"invalid code -- missing end-of-block";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -478,9 +478,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/lengths set";
|
strm->msg = (z_const char *)"invalid literal/lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -491,9 +491,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distances set";
|
strm->msg = (z_const char *)"invalid distances set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -556,9 +556,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
/* invalid code */
|
/* invalid code */
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -592,9 +592,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -611,9 +611,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
||||||
left : 0)) {
|
left : 0)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -155,7 +155,7 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
dist += (unsigned)hold & ((1U << op) - 1);
|
dist += (unsigned)hold & ((1U << op) - 1);
|
||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (dist > dmax) {
|
if (dist > dmax) {
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -169,10 +169,10 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
if (op > whave) {
|
if (op > whave) {
|
||||||
if (state->sane) {
|
if (state->sane) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg =
|
strm->msg =
|
||||||
(char *)"invalid distance too far back";
|
(z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -270,9 +270,9 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -289,9 +289,9 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -643,18 +643,18 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#endif
|
#endif
|
||||||
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect header check";
|
strm->msg = (z_const char *)"incorrect header check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (BITS(4) != Z_DEFLATED) {
|
if (BITS(4) != Z_DEFLATED) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown compression method";
|
strm->msg = (z_const char *)"unknown compression method";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -665,8 +665,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->wbits = len;
|
state->wbits = len;
|
||||||
if (len > 15 || len > state->wbits) {
|
if (len > 15 || len > state->wbits) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
|
strm->msg = (z_const char *)"invalid window size";
|
||||||
strm->msg = (char *)"invalid window size";
|
strm->msg = (char *)"invalid window size";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
|
@ -685,18 +686,18 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->flags = (int)(hold);
|
state->flags = (int)(hold);
|
||||||
if ((state->flags & 0xff) != Z_DEFLATED) {
|
if ((state->flags & 0xff) != Z_DEFLATED) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown compression method";
|
strm->msg = (z_const char *)"unknown compression method";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (state->flags & 0xe000) {
|
if (state->flags & 0xe000) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown header flags set";
|
strm->msg = (z_const char *)"unknown header flags set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -814,9 +815,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
|
if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"header crc mismatch";
|
strm->msg = (z_const char *)"header crc mismatch";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -880,9 +881,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid block type";
|
strm->msg = (z_const char *)"invalid block type";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
}
|
}
|
||||||
|
@ -893,9 +894,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid stored block lengths";
|
strm->msg = (z_const char *)"invalid stored block lengths";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -938,9 +939,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"too many length or distance symbols";
|
strm->msg = (z_const char *)"too many length or distance symbols";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -967,7 +968,7 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = "error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code lengths set";
|
strm->msg = (z_const char *)"invalid code lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -993,9 +994,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1020,9 +1021,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1038,9 +1039,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
/* check for end-of-block code (better have one) */
|
/* check for end-of-block code (better have one) */
|
||||||
if (state->lens[256] == 0) {
|
if (state->lens[256] == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code -- missing end-of-block";
|
strm->msg = (z_const char *)"invalid code -- missing end-of-block";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1056,9 +1057,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/lengths set";
|
strm->msg = (z_const char *)"invalid literal/lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1069,9 +1070,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distances set";
|
strm->msg = (z_const char *)"invalid distances set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1129,9 +1130,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
}
|
}
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1171,9 +1172,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->back += here.bits;
|
state->back += here.bits;
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1192,9 +1193,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (state->offset > state->dmax) {
|
if (state->offset > state->dmax) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1211,9 +1212,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
if (copy > state->whave) {
|
if (copy > state->whave) {
|
||||||
if (state->sane) {
|
if (state->sane) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1274,9 +1275,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#endif
|
#endif
|
||||||
ZSWAP32(hold)) != state->check) {
|
ZSWAP32(hold)) != state->check) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect data check";
|
strm->msg = (z_const char *)"incorrect data check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1292,9 +1293,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect length check";
|
strm->msg = (z_const char *)"incorrect length check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -597,11 +597,11 @@ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
|
||||||
Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
|
Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
|
||||||
compression for PNG image data than Huffman only. The degree of string
|
compression for PNG image data than Huffman only. The degree of string
|
||||||
matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
|
matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
|
||||||
Z_HUFFMAN. The strategy parameter affects the compression ratio but never
|
Z_HUFFMAN_ONLY. The strategy parameter affects the compression ratio but
|
||||||
the correctness of the compressed output, even if it is not set optimally
|
never the correctness of the compressed output, even if it is not set
|
||||||
for the given data. Z_FIXED uses the default string matching, but prevents
|
optimally for the given data. Z_FIXED uses the default string matching, but
|
||||||
the use of dynamic Huffman codes, allowing for a simpler decoder for special
|
prevents the use of dynamic Huffman codes, allowing for a simpler decoder
|
||||||
applications.
|
for special applications.
|
||||||
|
|
||||||
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||||
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
|
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: ifconfig.c,v 1.473 2024/06/09 16:25:27 jan Exp $ */
|
/* $OpenBSD: ifconfig.c,v 1.474 2024/06/29 12:09:51 jsg Exp $ */
|
||||||
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
|
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3209,10 +3209,6 @@ print_tunnel(const struct if_laddrreq *req)
|
||||||
printf(":%s", psrcport);
|
printf(":%s", psrcport);
|
||||||
|
|
||||||
if (req->dstaddr.ss_family != AF_UNSPEC) {
|
if (req->dstaddr.ss_family != AF_UNSPEC) {
|
||||||
in_port_t dstport = 0;
|
|
||||||
const struct sockaddr_in *sin;
|
|
||||||
const struct sockaddr_in6 *sin6;
|
|
||||||
|
|
||||||
if (getnameinfo((struct sockaddr *)&req->dstaddr,
|
if (getnameinfo((struct sockaddr *)&req->dstaddr,
|
||||||
req->dstaddr.ss_len, pdstaddr, sizeof(pdstaddr),
|
req->dstaddr.ss_len, pdstaddr, sizeof(pdstaddr),
|
||||||
pdstport, sizeof(pdstport), niflag) != 0)
|
pdstport, sizeof(pdstport), niflag) != 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: resolver.c,v 1.166 2024/05/21 05:00:48 jsg Exp $ */
|
/* $OpenBSD: resolver.c,v 1.167 2024/06/29 17:25:56 florian Exp $ */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -158,8 +158,10 @@ void asr_resolve_done(struct asr_result *, void *);
|
||||||
void new_resolver(enum uw_resolver_type,
|
void new_resolver(enum uw_resolver_type,
|
||||||
enum uw_resolver_state);
|
enum uw_resolver_state);
|
||||||
struct uw_resolver *create_resolver(enum uw_resolver_type);
|
struct uw_resolver *create_resolver(enum uw_resolver_type);
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
void setup_unified_caches(void);
|
void setup_unified_caches(void);
|
||||||
void set_unified_cache(struct uw_resolver *);
|
void set_unified_cache(struct uw_resolver *);
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
void free_resolver(struct uw_resolver *);
|
void free_resolver(struct uw_resolver *);
|
||||||
void set_forwarders(struct uw_resolver *,
|
void set_forwarders(struct uw_resolver *,
|
||||||
struct uw_forwarder_head *, int);
|
struct uw_forwarder_head *, int);
|
||||||
|
@ -222,10 +224,12 @@ struct event_base *ev_base;
|
||||||
RB_GENERATE(force_tree, force_tree_entry, entry, force_tree_cmp)
|
RB_GENERATE(force_tree, force_tree_entry, entry, force_tree_cmp)
|
||||||
|
|
||||||
int val_id = -1;
|
int val_id = -1;
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
struct slabhash *unified_msg_cache;
|
struct slabhash *unified_msg_cache;
|
||||||
struct rrset_cache *unified_rrset_cache;
|
struct rrset_cache *unified_rrset_cache;
|
||||||
struct key_cache *unified_key_cache;
|
struct key_cache *unified_key_cache;
|
||||||
struct val_neg_cache *unified_neg_cache;
|
struct val_neg_cache *unified_neg_cache;
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
|
|
||||||
int dns64_present;
|
int dns64_present;
|
||||||
int available_afs = HAVE_IPV4 | HAVE_IPV6;
|
int available_afs = HAVE_IPV4 | HAVE_IPV6;
|
||||||
|
@ -431,7 +435,9 @@ resolver(int debug, int verbose)
|
||||||
fatalx("local libunbound/util/alloc.c diff lost");
|
fatalx("local libunbound/util/alloc.c diff lost");
|
||||||
alloc_clear(&cache_alloc_test);
|
alloc_clear(&cache_alloc_test);
|
||||||
|
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
setup_unified_caches();
|
setup_unified_caches();
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
|
|
||||||
TAILQ_INIT(&autoconf_forwarder_list);
|
TAILQ_INIT(&autoconf_forwarder_list);
|
||||||
TAILQ_INIT(&trust_anchors);
|
TAILQ_INIT(&trust_anchors);
|
||||||
|
@ -1156,7 +1162,9 @@ new_resolver(enum uw_resolver_type type, enum uw_resolver_state state)
|
||||||
check_resolver(resolvers[type]);
|
check_resolver(resolvers[type]);
|
||||||
break;
|
break;
|
||||||
case VALIDATING:
|
case VALIDATING:
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
set_unified_cache(resolvers[type]);
|
set_unified_cache(resolvers[type]);
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
case RESOLVING:
|
case RESOLVING:
|
||||||
resolvers[type]->state = state;
|
resolvers[type]->state = state;
|
||||||
|
@ -1166,6 +1174,7 @@ new_resolver(enum uw_resolver_type type, enum uw_resolver_state state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
void
|
void
|
||||||
set_unified_cache(struct uw_resolver *res)
|
set_unified_cache(struct uw_resolver *res)
|
||||||
{
|
{
|
||||||
|
@ -1198,6 +1207,7 @@ set_unified_cache(struct uw_resolver *res)
|
||||||
fatalx("failed to set unified caches, libunbound/validator/"
|
fatalx("failed to set unified caches, libunbound/validator/"
|
||||||
"validator.c diff lost");
|
"validator.c diff lost");
|
||||||
}
|
}
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -1393,8 +1403,6 @@ create_resolver(enum uw_resolver_type type)
|
||||||
void
|
void
|
||||||
free_resolver(struct uw_resolver *res)
|
free_resolver(struct uw_resolver *res)
|
||||||
{
|
{
|
||||||
struct val_env *val_env;
|
|
||||||
|
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1402,8 +1410,11 @@ free_resolver(struct uw_resolver *res)
|
||||||
res->stop = 1;
|
res->stop = 1;
|
||||||
else {
|
else {
|
||||||
evtimer_del(&res->check_ev);
|
evtimer_del(&res->check_ev);
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
if (res->ctx != NULL) {
|
if (res->ctx != NULL) {
|
||||||
if (res->ctx->env->msg_cache == unified_msg_cache) {
|
if (res->ctx->env->msg_cache == unified_msg_cache) {
|
||||||
|
struct val_env *val_env;
|
||||||
|
|
||||||
val_env = (struct val_env*)
|
val_env = (struct val_env*)
|
||||||
res->ctx->env->modinfo[val_id];
|
res->ctx->env->modinfo[val_id];
|
||||||
res->ctx->env->msg_cache = NULL;
|
res->ctx->env->msg_cache = NULL;
|
||||||
|
@ -1414,12 +1425,14 @@ free_resolver(struct uw_resolver *res)
|
||||||
res->ctx->env->neg_cache = NULL;
|
res->ctx->env->neg_cache = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
ub_ctx_delete(res->ctx);
|
ub_ctx_delete(res->ctx);
|
||||||
asr_resolver_free(res->asr_ctx);
|
asr_resolver_free(res->asr_ctx);
|
||||||
free(res);
|
free(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
void
|
void
|
||||||
setup_unified_caches(void)
|
setup_unified_caches(void)
|
||||||
{
|
{
|
||||||
|
@ -1470,6 +1483,7 @@ setup_unified_caches(void)
|
||||||
val_env->neg_cache = NULL;
|
val_env->neg_cache = NULL;
|
||||||
ub_ctx_delete(ctx);
|
ub_ctx_delete(ctx);
|
||||||
}
|
}
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
|
|
||||||
void
|
void
|
||||||
set_forwarders(struct uw_resolver *res, struct uw_forwarder_head
|
set_forwarders(struct uw_resolver *res, struct uw_forwarder_head
|
||||||
|
@ -1836,6 +1850,7 @@ show_mem(pid_t pid)
|
||||||
struct ctl_mem_info cmi;
|
struct ctl_mem_info cmi;
|
||||||
|
|
||||||
memset(&cmi, 0, sizeof(cmi));
|
memset(&cmi, 0, sizeof(cmi));
|
||||||
|
#ifdef UNIFIED_CACHE
|
||||||
cmi.msg_cache_used = slabhash_get_mem(unified_msg_cache);
|
cmi.msg_cache_used = slabhash_get_mem(unified_msg_cache);
|
||||||
cmi.msg_cache_max = slabhash_get_size(unified_msg_cache);
|
cmi.msg_cache_max = slabhash_get_size(unified_msg_cache);
|
||||||
cmi.rrset_cache_used = slabhash_get_mem(&unified_rrset_cache->table);
|
cmi.rrset_cache_used = slabhash_get_mem(&unified_rrset_cache->table);
|
||||||
|
@ -1844,6 +1859,7 @@ show_mem(pid_t pid)
|
||||||
cmi.key_cache_max = slabhash_get_size(unified_key_cache->slab);
|
cmi.key_cache_max = slabhash_get_size(unified_key_cache->slab);
|
||||||
cmi.neg_cache_used = unified_neg_cache->use;
|
cmi.neg_cache_used = unified_neg_cache->use;
|
||||||
cmi.neg_cache_max = unified_neg_cache->max;
|
cmi.neg_cache_max = unified_neg_cache->max;
|
||||||
|
#endif /* UNIFIED_CACHE */
|
||||||
resolver_imsg_compose_frontend(IMSG_CTL_MEM_INFO, pid, &cmi,
|
resolver_imsg_compose_frontend(IMSG_CTL_MEM_INFO, pid, &cmi,
|
||||||
sizeof(cmi));
|
sizeof(cmi));
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.\" $OpenBSD: pci.4,v 1.406 2024/04/09 20:18:37 mglocker Exp $
|
.\" $OpenBSD: pci.4,v 1.407 2024/06/30 08:13:02 kevlo Exp $
|
||||||
.\" $NetBSD: pci.4,v 1.29 2000/04/01 00:32:23 tsarna Exp $
|
.\" $NetBSD: pci.4,v 1.29 2000/04/01 00:32:23 tsarna Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2000 Theo de Raadt. All rights reserved.
|
.\" Copyright (c) 2000 Theo de Raadt. All rights reserved.
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: April 9 2024 $
|
.Dd $Mdocdate: June 30 2024 $
|
||||||
.Dt PCI 4
|
.Dt PCI 4
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
|
@ -257,7 +257,7 @@ AMD PCnet-PCI 10/100 Ethernet device
|
||||||
.It Xr re 4
|
.It Xr re 4
|
||||||
Realtek 8139C+/8169/816xS/811xS/8168/810xE 10/100/1Gb Ethernet device
|
Realtek 8139C+/8169/816xS/811xS/8168/810xE 10/100/1Gb Ethernet device
|
||||||
.It Xr rge 4
|
.It Xr rge 4
|
||||||
Realtek 8125/8125B PCI Express 10/100/1Gb/2.5Gb Ethernet device
|
Realtek 8125/8125B/8126 PCI Express 10/100/1Gb/2.5Gb/5Gb Ethernet device
|
||||||
.It Xr rl 4
|
.It Xr rl 4
|
||||||
Realtek 8129/8139 10/100 Ethernet device
|
Realtek 8129/8139 10/100 Ethernet device
|
||||||
.It Xr se 4
|
.It Xr se 4
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.\" $OpenBSD: rge.4,v 1.6 2021/09/08 20:33:42 jmc Exp $
|
.\" $OpenBSD: rge.4,v 1.7 2024/06/30 08:13:02 kevlo Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 2019, 2020 Kevin Lo <kevlo@openbsd.org>
|
.\" Copyright (c) 2019, 2020, 2024 Kevin Lo <kevlo@openbsd.org>
|
||||||
.\"
|
.\"
|
||||||
.\" Permission to use, copy, modify, and distribute this software for any
|
.\" Permission to use, copy, modify, and distribute this software for any
|
||||||
.\" purpose with or without fee is hereby granted, provided that the above
|
.\" purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -14,23 +14,25 @@
|
||||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
.\"
|
.\"
|
||||||
.Dd $Mdocdate: September 8 2021 $
|
.Dd $Mdocdate: June 30 2024 $
|
||||||
.Dt RGE 4
|
.Dt RGE 4
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm rge
|
.Nm rge
|
||||||
.Nd Realtek 8125/8125B PCI Express 10/100/1Gb/2.5Gb Ethernet device
|
.Nd Realtek 8125/8125B/8126 PCI Express 10/100/1Gb/2.5Gb/5Gb Ethernet device
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Cd "rge* at pci?"
|
.Cd "rge* at pci?"
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
driver provides support for PCI Express 2.5Gb Ethernet adapters based
|
driver provides support for NICs based on the
|
||||||
on the Realtek RTL8125 and RTL8125B Ethernet controllers,
|
Realtek RTL8125, RTL8125B and RTL8126 PCI Express Ethernet controllers,
|
||||||
including the following:
|
including the following:
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -bullet -offset indent -compact
|
.Bl -bullet -offset indent -compact
|
||||||
.It
|
.It
|
||||||
|
IOCrest IO-PCE8126-GLAN Adapter (5000baseT)
|
||||||
|
.It
|
||||||
Realtek 8125/8125B 2.5GbE Adapter (2500baseT)
|
Realtek 8125/8125B 2.5GbE Adapter (2500baseT)
|
||||||
.It
|
.It
|
||||||
Rivet Networks Killer E3000 Adapter (2500baseT)
|
Rivet Networks Killer E3000 Adapter (2500baseT)
|
||||||
|
@ -38,6 +40,11 @@ Rivet Networks Killer E3000 Adapter (2500baseT)
|
||||||
TP-LINK TL-NG421 Adapter (2500baseT)
|
TP-LINK TL-NG421 Adapter (2500baseT)
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
|
NICs based on the 8125 and 8125B are capable of 10, 100, 1000 and
|
||||||
|
2500Mbps operation.
|
||||||
|
NICs based on the 8126 are capable of 10, 100, 1000, 2500 and
|
||||||
|
5000Mbps operation.
|
||||||
|
.Pp
|
||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
driver additionally supports Wake on LAN (WoL).
|
driver additionally supports Wake on LAN (WoL).
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: acpivar.h,v 1.128 2024/06/25 11:57:10 kettenis Exp $ */
|
/* $OpenBSD: acpivar.h,v 1.131 2024/06/30 00:29:36 jsg Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
|
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
|
||||||
*
|
*
|
||||||
|
@ -153,12 +153,6 @@ typedef SIMPLEQ_HEAD(, acpi_wakeq) acpi_wakeqhead_t;
|
||||||
#define ACPI_SST_SLEEPING 3
|
#define ACPI_SST_SLEEPING 3
|
||||||
#define ACPI_SST_SLEEP_CONTEXT 4
|
#define ACPI_SST_SLEEP_CONTEXT 4
|
||||||
|
|
||||||
struct acpi_parsestate {
|
|
||||||
uint8_t *start;
|
|
||||||
uint8_t *end;
|
|
||||||
uint8_t *pos;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct acpi_reg_map {
|
struct acpi_reg_map {
|
||||||
bus_space_handle_t ioh;
|
bus_space_handle_t ioh;
|
||||||
int addr;
|
int addr;
|
||||||
|
@ -300,22 +294,6 @@ extern struct acpi_softc *acpi_softc;
|
||||||
#define GPE_LEVEL 0x01
|
#define GPE_LEVEL 0x01
|
||||||
#define GPE_EDGE 0x02
|
#define GPE_EDGE 0x02
|
||||||
|
|
||||||
struct acpi_table {
|
|
||||||
int offset;
|
|
||||||
size_t size;
|
|
||||||
void *table;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct acpi_dev_rank {
|
|
||||||
struct device *dev;
|
|
||||||
int rank;
|
|
||||||
TAILQ_ENTRY(acpi_dev_rank) link;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define ACPI_IOC_GETFACS _IOR('A', 0, struct acpi_facs)
|
|
||||||
#define ACPI_IOC_GETTABLE _IOWR('A', 1, struct acpi_table)
|
|
||||||
#define ACPI_IOC_SETSLEEPSTATE _IOW('A', 2, int)
|
|
||||||
|
|
||||||
#if defined(_KERNEL)
|
#if defined(_KERNEL)
|
||||||
|
|
||||||
struct acpi_gas;
|
struct acpi_gas;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: nvme.c,v 1.117 2024/06/04 20:31:35 krw Exp $ */
|
/* $OpenBSD: nvme.c,v 1.118 2024/06/30 12:03:17 krw Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
|
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
|
||||||
|
@ -1799,7 +1799,7 @@ nvme_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size,
|
||||||
page_bus_phys = page_phys;
|
page_bus_phys = page_phys;
|
||||||
htolem64(&isqe->entry.prp[1], page_bus_phys +
|
htolem64(&isqe->entry.prp[1], page_bus_phys +
|
||||||
offsetof(struct nvme_hibernate_page, prpl));
|
offsetof(struct nvme_hibernate_page, prpl));
|
||||||
for (i = 1; i < (size / my->sc->sc_mps); i++) {
|
for (i = 1; i < howmany(size, my->sc->sc_mps); i++) {
|
||||||
htolem64(&my->prpl[i - 1], data_bus_phys +
|
htolem64(&my->prpl[i - 1], data_bus_phys +
|
||||||
(i * my->sc->sc_mps));
|
(i * my->sc->sc_mps));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
/* $OpenBSD: if_rge.c,v 1.26 2024/05/24 06:02:56 jsg Exp $ */
|
/* $OpenBSD: if_rge.c,v 1.27 2024/06/30 08:13:02 kevlo Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, 2020, 2023 Kevin Lo <kevlo@openbsd.org>
|
* Copyright (c) 2019, 2020, 2023, 2024
|
||||||
|
* Kevin Lo <kevlo@openbsd.org>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
|
@ -88,6 +89,7 @@ void rge_ephy_config(struct rge_softc *);
|
||||||
void rge_ephy_config_mac_cfg3(struct rge_softc *);
|
void rge_ephy_config_mac_cfg3(struct rge_softc *);
|
||||||
void rge_ephy_config_mac_cfg5(struct rge_softc *);
|
void rge_ephy_config_mac_cfg5(struct rge_softc *);
|
||||||
int rge_phy_config(struct rge_softc *);
|
int rge_phy_config(struct rge_softc *);
|
||||||
|
void rge_phy_config_mac_cfg2_8126(struct rge_softc *);
|
||||||
void rge_phy_config_mac_cfg3(struct rge_softc *);
|
void rge_phy_config_mac_cfg3(struct rge_softc *);
|
||||||
void rge_phy_config_mac_cfg5(struct rge_softc *);
|
void rge_phy_config_mac_cfg5(struct rge_softc *);
|
||||||
void rge_phy_config_mcu(struct rge_softc *, uint16_t);
|
void rge_phy_config_mcu(struct rge_softc *, uint16_t);
|
||||||
|
@ -136,6 +138,8 @@ static const struct {
|
||||||
RTL8125_MAC_CFG3_MCU
|
RTL8125_MAC_CFG3_MCU
|
||||||
}, rtl8125_mac_cfg5_mcu[] = {
|
}, rtl8125_mac_cfg5_mcu[] = {
|
||||||
RTL8125_MAC_CFG5_MCU
|
RTL8125_MAC_CFG5_MCU
|
||||||
|
}, rtl8126_mac_cfg2_mcu[] = {
|
||||||
|
RTL8126_MAC_CFG2_MCU
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct cfattach rge_ca = {
|
const struct cfattach rge_ca = {
|
||||||
|
@ -148,7 +152,8 @@ struct cfdriver rge_cd = {
|
||||||
|
|
||||||
const struct pci_matchid rge_devices[] = {
|
const struct pci_matchid rge_devices[] = {
|
||||||
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_E3000 },
|
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_E3000 },
|
||||||
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8125 }
|
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8125 },
|
||||||
|
{ PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8126 }
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -239,6 +244,9 @@ rge_attach(struct device *parent, struct device *self, void *aux)
|
||||||
case 0x64100000:
|
case 0x64100000:
|
||||||
sc->rge_type = MAC_CFG5;
|
sc->rge_type = MAC_CFG5;
|
||||||
break;
|
break;
|
||||||
|
case 0x64900000:
|
||||||
|
sc->rge_type = MAC_CFG2_8126;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
printf(": unknown version 0x%08x\n", hwrev);
|
printf(": unknown version 0x%08x\n", hwrev);
|
||||||
return;
|
return;
|
||||||
|
@ -626,7 +634,7 @@ rge_init(struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
struct rge_softc *sc = ifp->if_softc;
|
struct rge_softc *sc = ifp->if_softc;
|
||||||
struct rge_queues *q = sc->sc_queues;
|
struct rge_queues *q = sc->sc_queues;
|
||||||
uint32_t val;
|
uint32_t rxconf, val;
|
||||||
int i, num_miti;
|
int i, num_miti;
|
||||||
|
|
||||||
rge_stop(ifp);
|
rge_stop(ifp);
|
||||||
|
@ -649,7 +657,6 @@ rge_init(struct ifnet *ifp)
|
||||||
rge_disable_aspm_clkreq(sc);
|
rge_disable_aspm_clkreq(sc);
|
||||||
RGE_WRITE_2(sc, RGE_EEE_TXIDLE_TIMER,
|
RGE_WRITE_2(sc, RGE_EEE_TXIDLE_TIMER,
|
||||||
RGE_JUMBO_MTU + ETHER_HDR_LEN + 32);
|
RGE_JUMBO_MTU + ETHER_HDR_LEN + 32);
|
||||||
RGE_CLRBIT_1(sc, RGE_CFG3, RGE_CFG3_RDY_TO_L23);
|
|
||||||
|
|
||||||
/* Load the addresses of the RX and TX lists into the chip. */
|
/* Load the addresses of the RX and TX lists into the chip. */
|
||||||
RGE_WRITE_4(sc, RGE_RXDESC_ADDR_LO,
|
RGE_WRITE_4(sc, RGE_RXDESC_ADDR_LO,
|
||||||
|
@ -662,14 +669,23 @@ rge_init(struct ifnet *ifp)
|
||||||
RGE_ADDR_HI(q->q_tx.rge_tx_list_map->dm_segs[0].ds_addr));
|
RGE_ADDR_HI(q->q_tx.rge_tx_list_map->dm_segs[0].ds_addr));
|
||||||
|
|
||||||
/* Set the initial RX and TX configurations. */
|
/* Set the initial RX and TX configurations. */
|
||||||
RGE_WRITE_4(sc, RGE_RXCFG,
|
if (sc->rge_type == MAC_CFG3)
|
||||||
(sc->rge_type == MAC_CFG3) ? RGE_RXCFG_CONFIG :
|
rxconf = RGE_RXCFG_CONFIG;
|
||||||
RGE_RXCFG_CONFIG_8125B);
|
else if (sc->rge_type == MAC_CFG5)
|
||||||
|
rxconf = RGE_RXCFG_CONFIG_8125B;
|
||||||
|
else
|
||||||
|
rxconf = RGE_RXCFG_CONFIG_8126;
|
||||||
|
RGE_WRITE_4(sc, RGE_RXCFG, rxconf);
|
||||||
RGE_WRITE_4(sc, RGE_TXCFG, RGE_TXCFG_CONFIG);
|
RGE_WRITE_4(sc, RGE_TXCFG, RGE_TXCFG_CONFIG);
|
||||||
|
|
||||||
val = rge_read_csi(sc, 0x70c) & ~0xff000000;
|
val = rge_read_csi(sc, 0x70c) & ~0xff000000;
|
||||||
rge_write_csi(sc, 0x70c, val | 0x27000000);
|
rge_write_csi(sc, 0x70c, val | 0x27000000);
|
||||||
|
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126) {
|
||||||
|
/* Disable L1 timeout. */
|
||||||
|
val = rge_read_csi(sc, 0x890) & ~0x00000001;
|
||||||
|
rge_write_csi(sc, 0x890, val);
|
||||||
|
} else
|
||||||
RGE_WRITE_2(sc, 0x0382, 0x221b);
|
RGE_WRITE_2(sc, 0x0382, 0x221b);
|
||||||
|
|
||||||
RGE_WRITE_1(sc, RGE_RSS_CTRL, 0);
|
RGE_WRITE_1(sc, RGE_RSS_CTRL, 0);
|
||||||
|
@ -684,18 +700,23 @@ rge_init(struct ifnet *ifp)
|
||||||
|
|
||||||
RGE_MAC_SETBIT(sc, 0xeb58, 0x0001);
|
RGE_MAC_SETBIT(sc, 0xeb58, 0x0001);
|
||||||
|
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_CLRBIT_1(sc, 0xd8, 0x02);
|
||||||
|
|
||||||
val = rge_read_mac_ocp(sc, 0xe614) & ~0x0700;
|
val = rge_read_mac_ocp(sc, 0xe614) & ~0x0700;
|
||||||
if (sc->rge_type == MAC_CFG3)
|
if (sc->rge_type == MAC_CFG3)
|
||||||
rge_write_mac_ocp(sc, 0xe614, val | 0x0300);
|
rge_write_mac_ocp(sc, 0xe614, val | 0x0300);
|
||||||
else
|
else if (sc->rge_type == MAC_CFG5)
|
||||||
rge_write_mac_ocp(sc, 0xe614, val | 0x0200);
|
rge_write_mac_ocp(sc, 0xe614, val | 0x0200);
|
||||||
|
else
|
||||||
|
rge_write_mac_ocp(sc, 0xe614, val | 0x0400);
|
||||||
|
|
||||||
val = rge_read_mac_ocp(sc, 0xe63e) & ~0x0c00;
|
val = rge_read_mac_ocp(sc, 0xe63e) & ~0x0c00;
|
||||||
rge_write_mac_ocp(sc, 0xe63e, val |
|
rge_write_mac_ocp(sc, 0xe63e, val |
|
||||||
((fls(sc->sc_nqueues) - 1) & 0x03) << 10);
|
((fls(sc->sc_nqueues) - 1) & 0x03) << 10);
|
||||||
|
|
||||||
RGE_MAC_CLRBIT(sc, 0xe63e, 0x0030);
|
RGE_MAC_CLRBIT(sc, 0xe63e, 0x0030);
|
||||||
if (sc->rge_type == MAC_CFG3)
|
if (sc->rge_type != MAC_CFG5)
|
||||||
RGE_MAC_SETBIT(sc, 0xe63e, 0x0020);
|
RGE_MAC_SETBIT(sc, 0xe63e, 0x0020);
|
||||||
|
|
||||||
RGE_MAC_CLRBIT(sc, 0xc0b4, 0x0001);
|
RGE_MAC_CLRBIT(sc, 0xc0b4, 0x0001);
|
||||||
|
@ -734,6 +755,9 @@ rge_init(struct ifnet *ifp)
|
||||||
/* Disable EEE plus. */
|
/* Disable EEE plus. */
|
||||||
RGE_MAC_CLRBIT(sc, 0xe080, 0x0002);
|
RGE_MAC_CLRBIT(sc, 0xe080, 0x0002);
|
||||||
|
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_MAC_CLRBIT(sc, 0xea1c, 0x0304);
|
||||||
|
else
|
||||||
RGE_MAC_CLRBIT(sc, 0xea1c, 0x0004);
|
RGE_MAC_CLRBIT(sc, 0xea1c, 0x0004);
|
||||||
|
|
||||||
RGE_MAC_SETBIT(sc, 0xeb54, 0x0001);
|
RGE_MAC_SETBIT(sc, 0xeb54, 0x0001);
|
||||||
|
@ -742,8 +766,8 @@ rge_init(struct ifnet *ifp)
|
||||||
|
|
||||||
RGE_CLRBIT_2(sc, 0x1880, 0x0030);
|
RGE_CLRBIT_2(sc, 0x1880, 0x0030);
|
||||||
|
|
||||||
/* Config interrupt type for RTL8125B. */
|
/* Config interrupt type for RTL8125B/RTL8126. */
|
||||||
if (sc->rge_type == MAC_CFG5)
|
if (sc->rge_type != MAC_CFG3)
|
||||||
RGE_CLRBIT_1(sc, RGE_INT_CFG0, RGE_INT_CFG0_EN);
|
RGE_CLRBIT_1(sc, RGE_INT_CFG0, RGE_INT_CFG0_EN);
|
||||||
|
|
||||||
/* Clear timer interrupts. */
|
/* Clear timer interrupts. */
|
||||||
|
@ -879,26 +903,31 @@ rge_ifmedia_upd(struct ifnet *ifp)
|
||||||
/* Disable Gigabit Lite. */
|
/* Disable Gigabit Lite. */
|
||||||
RGE_PHY_CLRBIT(sc, 0xa428, 0x0200);
|
RGE_PHY_CLRBIT(sc, 0xa428, 0x0200);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa5ea, 0x0001);
|
RGE_PHY_CLRBIT(sc, 0xa5ea, 0x0001);
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xa5ea, 0x0002);
|
||||||
|
|
||||||
val = rge_read_phy_ocp(sc, 0xa5d4);
|
val = rge_read_phy_ocp(sc, 0xa5d4);
|
||||||
val &= ~RGE_ADV_2500TFDX;
|
val &= ~RGE_ADV_2500TFDX;
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
val &= ~RGE_ADV_5000TFDX;
|
||||||
|
|
||||||
|
anar = ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10;
|
||||||
|
gig = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
|
||||||
|
|
||||||
anar = gig = 0;
|
|
||||||
switch (IFM_SUBTYPE(ifm->ifm_media)) {
|
switch (IFM_SUBTYPE(ifm->ifm_media)) {
|
||||||
case IFM_AUTO:
|
case IFM_AUTO:
|
||||||
anar = ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10;
|
val |= (sc->rge_type != MAC_CFG2_8126) ?
|
||||||
gig = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
|
RGE_ADV_2500TFDX : (RGE_ADV_2500TFDX | RGE_ADV_5000TFDX);
|
||||||
val |= RGE_ADV_2500TFDX;
|
break;
|
||||||
|
case IFM_5000_T:
|
||||||
|
val |= RGE_ADV_5000TFDX;
|
||||||
|
ifp->if_baudrate = IF_Gbps(5);
|
||||||
break;
|
break;
|
||||||
case IFM_2500_T:
|
case IFM_2500_T:
|
||||||
anar = ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10;
|
|
||||||
gig = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
|
|
||||||
val |= RGE_ADV_2500TFDX;
|
val |= RGE_ADV_2500TFDX;
|
||||||
ifp->if_baudrate = IF_Mbps(2500);
|
ifp->if_baudrate = IF_Mbps(2500);
|
||||||
break;
|
break;
|
||||||
case IFM_1000_T:
|
case IFM_1000_T:
|
||||||
anar = ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10;
|
|
||||||
gig = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
|
|
||||||
ifp->if_baudrate = IF_Gbps(1);
|
ifp->if_baudrate = IF_Gbps(1);
|
||||||
break;
|
break;
|
||||||
case IFM_100_TX:
|
case IFM_100_TX:
|
||||||
|
@ -947,7 +976,7 @@ rge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||||
|
|
||||||
status = RGE_READ_2(sc, RGE_PHYSTAT);
|
status = RGE_READ_2(sc, RGE_PHYSTAT);
|
||||||
if ((status & RGE_PHYSTAT_FDX) ||
|
if ((status & RGE_PHYSTAT_FDX) ||
|
||||||
(status & RGE_PHYSTAT_2500MBPS))
|
(status & (RGE_PHYSTAT_2500MBPS | RGE_PHYSTAT_5000MBPS)))
|
||||||
ifmr->ifm_active |= IFM_FDX;
|
ifmr->ifm_active |= IFM_FDX;
|
||||||
else
|
else
|
||||||
ifmr->ifm_active |= IFM_HDX;
|
ifmr->ifm_active |= IFM_HDX;
|
||||||
|
@ -960,6 +989,8 @@ rge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||||
ifmr->ifm_active |= IFM_1000_T;
|
ifmr->ifm_active |= IFM_1000_T;
|
||||||
else if (status & RGE_PHYSTAT_2500MBPS)
|
else if (status & RGE_PHYSTAT_2500MBPS)
|
||||||
ifmr->ifm_active |= IFM_2500_T;
|
ifmr->ifm_active |= IFM_2500_T;
|
||||||
|
else if (status & RGE_PHYSTAT_5000MBPS)
|
||||||
|
ifmr->ifm_active |= IFM_5000_T;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1394,11 +1425,13 @@ rge_reset(struct rge_softc *sc)
|
||||||
DELAY(2000);
|
DELAY(2000);
|
||||||
|
|
||||||
RGE_SETBIT_1(sc, RGE_CMD, RGE_CMD_STOPREQ);
|
RGE_SETBIT_1(sc, RGE_CMD, RGE_CMD_STOPREQ);
|
||||||
|
if (sc->rge_type != MAC_CFG2_8126) {
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
DELAY(10);
|
DELAY(10);
|
||||||
if (!(RGE_READ_1(sc, RGE_CMD) & RGE_CMD_STOPREQ))
|
if (!(RGE_READ_1(sc, RGE_CMD) & RGE_CMD_STOPREQ))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < 3000; i++) {
|
for (i = 0; i < 3000; i++) {
|
||||||
DELAY(50);
|
DELAY(50);
|
||||||
|
@ -1522,7 +1555,7 @@ rge_ephy_config(struct rge_softc *sc)
|
||||||
rge_ephy_config_mac_cfg5(sc);
|
rge_ephy_config_mac_cfg5(sc);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; /* Can't happen. */
|
break; /* Nothing to do. */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1576,6 +1609,9 @@ rge_phy_config(struct rge_softc *sc)
|
||||||
rge_write_phy(sc, 0, MII_100T2CR,
|
rge_write_phy(sc, 0, MII_100T2CR,
|
||||||
rge_read_phy(sc, 0, MII_100T2CR) &
|
rge_read_phy(sc, 0, MII_100T2CR) &
|
||||||
~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX));
|
~(GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX));
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xa5d4, RGE_ADV_2500TFDX | RGE_ADV_5000TFDX);
|
||||||
|
else
|
||||||
RGE_PHY_CLRBIT(sc, 0xa5d4, RGE_ADV_2500TFDX);
|
RGE_PHY_CLRBIT(sc, 0xa5d4, RGE_ADV_2500TFDX);
|
||||||
rge_write_phy(sc, 0, MII_BMCR, BMCR_RESET | BMCR_AUTOEN |
|
rge_write_phy(sc, 0, MII_BMCR, BMCR_RESET | BMCR_AUTOEN |
|
||||||
BMCR_STARTNEG);
|
BMCR_STARTNEG);
|
||||||
|
@ -1594,6 +1630,9 @@ rge_phy_config(struct rge_softc *sc)
|
||||||
sc->rge_mcodever = rge_read_phy_ocp(sc, 0xa438);
|
sc->rge_mcodever = rge_read_phy_ocp(sc, 0xa438);
|
||||||
|
|
||||||
switch (sc->rge_type) {
|
switch (sc->rge_type) {
|
||||||
|
case MAC_CFG2_8126:
|
||||||
|
rge_phy_config_mac_cfg2_8126(sc);
|
||||||
|
break;
|
||||||
case MAC_CFG3:
|
case MAC_CFG3:
|
||||||
rge_phy_config_mac_cfg3(sc);
|
rge_phy_config_mac_cfg3(sc);
|
||||||
break;
|
break;
|
||||||
|
@ -1611,23 +1650,305 @@ rge_phy_config(struct rge_softc *sc)
|
||||||
if (sc->rge_type == MAC_CFG3) {
|
if (sc->rge_type == MAC_CFG3) {
|
||||||
RGE_MAC_CLRBIT(sc, 0xeb62, 0x0006);
|
RGE_MAC_CLRBIT(sc, 0xeb62, 0x0006);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa432, 0x0010);
|
RGE_PHY_CLRBIT(sc, 0xa432, 0x0010);
|
||||||
}
|
} else if (sc->rge_type == MAC_CFG5)
|
||||||
|
RGE_PHY_SETBIT(sc, 0xa432, 0x0010);
|
||||||
|
|
||||||
RGE_PHY_CLRBIT(sc, 0xa5d0, 0x0006);
|
RGE_PHY_CLRBIT(sc, 0xa5d0, 0x0006);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa6d4, 0x0001);
|
RGE_PHY_CLRBIT(sc, 0xa6d4, 0x0001);
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xa6d4, 0x0002);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa6d8, 0x0010);
|
RGE_PHY_CLRBIT(sc, 0xa6d8, 0x0010);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa428, 0x0080);
|
RGE_PHY_CLRBIT(sc, 0xa428, 0x0080);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa4a2, 0x0200);
|
RGE_PHY_CLRBIT(sc, 0xa4a2, 0x0200);
|
||||||
|
|
||||||
/* Advanced EEE. */
|
/* Disable advanced EEE. */
|
||||||
rge_patch_phy_mcu(sc, 1);
|
|
||||||
RGE_MAC_CLRBIT(sc, 0xe052, 0x0001);
|
RGE_MAC_CLRBIT(sc, 0xe052, 0x0001);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa442, 0x3000);
|
RGE_PHY_CLRBIT(sc, 0xa442, 0x3000);
|
||||||
RGE_PHY_CLRBIT(sc, 0xa430, 0x8000);
|
RGE_PHY_CLRBIT(sc, 0xa430, 0x8000);
|
||||||
rge_patch_phy_mcu(sc, 0);
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
rge_phy_config_mac_cfg2_8126(struct rge_softc *sc)
|
||||||
|
{
|
||||||
|
uint16_t val;
|
||||||
|
int i;
|
||||||
|
static const uint16_t mac_cfg2_a438_value[] =
|
||||||
|
{ 0x0044, 0x00a8, 0x00d6, 0x00ec, 0x00f6, 0x00fc, 0x00fe,
|
||||||
|
0x00fe, 0x00bc, 0x0058, 0x002a, 0x003f, 0x3f02, 0x023c,
|
||||||
|
0x3b0a, 0x1c00, 0x0000, 0x0000, 0x0000, 0x0000 };
|
||||||
|
|
||||||
|
static const uint16_t mac_cfg2_b87e_value[] =
|
||||||
|
{ 0x03ed, 0x03ff, 0x0009, 0x03fe, 0x000b, 0x0021, 0x03f7,
|
||||||
|
0x03b8, 0x03e0, 0x0049, 0x0049, 0x03e0, 0x03b8, 0x03f7,
|
||||||
|
0x0021, 0x000b, 0x03fe, 0x0009, 0x03ff, 0x03ed, 0x000e,
|
||||||
|
0x03fe, 0x03ed, 0x0006, 0x001a, 0x03f1, 0x03d8, 0x0023,
|
||||||
|
0x0054, 0x0322, 0x00dd, 0x03ab, 0x03dc, 0x0027, 0x000e,
|
||||||
|
0x03e5, 0x03f9, 0x0012, 0x0001, 0x03f1 };
|
||||||
|
|
||||||
|
rge_phy_config_mcu(sc, RGE_MAC_CFG2_8126_MCODE_VER);
|
||||||
|
|
||||||
|
RGE_PHY_SETBIT(sc, 0xa442, 0x0800);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80bf);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0xed00);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80cd);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x1000);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80d1);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0xc800);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80d4);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0xc800);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80e1);
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, 0x10cc);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x80e5);
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, 0x4f0c);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8387);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x4700);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa80c) & ~0x00c0;
|
||||||
|
rge_write_phy_ocp(sc, 0xa80c, val | 0x0080);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xac90, 0x0010);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xad2c, 0x8000);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8321);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x1100);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xacf8, 0x000c);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8183);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x5900);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xad94, 0x0020);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xa654, 0x0800);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xb648, 0x4000);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x839e);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x2f00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83f2);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0800);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xada0, 0x0002);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x80f3);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x9900);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8126);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0xc100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x893a);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x8080);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8647);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0xe600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x862c);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x1200);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x864a);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0xe600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x80a0);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0xbcbc);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x805e);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0xbcbc);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8056);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x3077);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8058);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x5a00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8098);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x3077);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x809a);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x5a00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8052);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x3733);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8094);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x3733);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x807f);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x7c75);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x803d);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x7c75);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8036);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x3000);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8078);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x3000);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8031);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x3300);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8073);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x3300);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xae06) & ~0xfc00;
|
||||||
|
rge_write_phy_ocp(sc, 0xae06, val | 0x7c00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x89D1);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0004);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8fbd);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x0a00);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8fbe);
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, 0x0d09);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x89cd);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0f0f);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x89cf);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0f0f);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83a4);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83a6);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6601);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83c0);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83c2);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6601);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8414);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8416);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6601);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83f8);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6600);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x83fa);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x6601);
|
||||||
|
|
||||||
|
rge_patch_phy_mcu(sc, 1);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xbd96) & ~0x1f00;
|
||||||
|
rge_write_phy_ocp(sc, 0xbd96, val | 0x1000);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xbf1c) & ~0x0007;
|
||||||
|
rge_write_phy_ocp(sc, 0xbf1c, val | 0x0007);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xbfbe, 0x8000);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xbf40) & ~0x0380;
|
||||||
|
rge_write_phy_ocp(sc, 0xbf40, val | 0x0280);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xbf90) & ~0x0080;
|
||||||
|
rge_write_phy_ocp(sc, 0xbf90, val | 0x0060);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xbf90) & ~0x0010;
|
||||||
|
rge_write_phy_ocp(sc, 0xbf90, val | 0x000c);
|
||||||
|
rge_patch_phy_mcu(sc, 0);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x843b);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x2000);
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x843d);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xa438) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, val | 0x2000);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xb516, 0x007f);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xbf80, 0x0030);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8188);
|
||||||
|
for (i = 0; i < 11; i++)
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, mac_cfg2_a438_value[i]);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8015);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0800);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8ffd);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fff);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x7f00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8ffb);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fe9);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0002);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fef);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x00a5);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8ff1);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0106);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fe1);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, 0x0102);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fe3);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0400);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xa654, 0x0800);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xa654, 0x0003);
|
||||||
|
rge_write_phy_ocp(sc, 0xac3a, 0x5851);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xac3c) & ~0xd000;
|
||||||
|
rge_write_phy_ocp(sc, 0xac3c, val | 0x2000);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xac42) & ~0x0200;
|
||||||
|
rge_write_phy_ocp(sc, 0xac42, val | 0x01c0);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xac3e, 0xe000);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xac42, 0x0038);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xac42) & ~0x0002;
|
||||||
|
rge_write_phy_ocp(sc, 0xac42, val | 0x0005);
|
||||||
|
rge_write_phy_ocp(sc, 0xac1a, 0x00db);
|
||||||
|
rge_write_phy_ocp(sc, 0xade4, 0x01b5);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xad9c, 0x0c00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x814b);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x1100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x814d);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x1100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x814f);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0b00);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8142);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8144);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8150);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8118);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0700);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x811a);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0700);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x811c);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0500);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x810f);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8111);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x811d);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0100);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xac36, 0x1000);
|
||||||
|
RGE_PHY_CLRBIT(sc, 0xad1c, 0x0100);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xade8) & ~0xffc0;
|
||||||
|
rge_write_phy_ocp(sc, 0xade8, val | 0x1400);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x864b);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x9d00);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8f97);
|
||||||
|
for (; i < nitems(mac_cfg2_a438_value); i++)
|
||||||
|
rge_write_phy_ocp(sc, 0xa438, mac_cfg2_a438_value[i]);
|
||||||
|
|
||||||
|
RGE_PHY_SETBIT(sc, 0xad9c, 0x0020);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8122);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0c00);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x82c8);
|
||||||
|
for (i = 0; i < 20; i++)
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, mac_cfg2_b87e_value[i]);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x80ef);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0x0c00);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x82a0);
|
||||||
|
for (; i < nitems(mac_cfg2_b87e_value); i++)
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, mac_cfg2_b87e_value[i]);
|
||||||
|
|
||||||
|
rge_write_phy_ocp(sc, 0xa436, 0x8018);
|
||||||
|
RGE_PHY_SETBIT(sc, 0xa438, 0x2000);
|
||||||
|
rge_write_phy_ocp(sc, 0xb87c, 0x8fe4);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb87e) & ~0xff00;
|
||||||
|
rge_write_phy_ocp(sc, 0xb87e, val | 0);
|
||||||
|
val = rge_read_phy_ocp(sc, 0xb54c) & ~0xffc0;
|
||||||
|
rge_write_phy_ocp(sc, 0xb54c, val | 0x3700);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
rge_phy_config_mac_cfg3(struct rge_softc *sc)
|
rge_phy_config_mac_cfg3(struct rge_softc *sc)
|
||||||
{
|
{
|
||||||
|
@ -1784,6 +2105,12 @@ rge_phy_config_mcu(struct rge_softc *sc, uint16_t mcode_version)
|
||||||
rtl8125_mac_cfg5_mcu[i].reg,
|
rtl8125_mac_cfg5_mcu[i].reg,
|
||||||
rtl8125_mac_cfg5_mcu[i].val);
|
rtl8125_mac_cfg5_mcu[i].val);
|
||||||
}
|
}
|
||||||
|
} else if (sc->rge_type == MAC_CFG2_8126) {
|
||||||
|
for (i = 0; i < nitems(rtl8126_mac_cfg2_mcu); i++) {
|
||||||
|
rge_write_phy_ocp(sc,
|
||||||
|
rtl8126_mac_cfg2_mcu[i].reg,
|
||||||
|
rtl8126_mac_cfg2_mcu[i].val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rge_patch_phy_mcu(sc, 0);
|
rge_patch_phy_mcu(sc, 0);
|
||||||
|
@ -1881,6 +2208,7 @@ rge_hw_init(struct rge_softc *sc)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable PHY power saving. */
|
/* Disable PHY power saving. */
|
||||||
|
if (sc->rge_type == MAC_CFG3)
|
||||||
rge_disable_phy_ocp_pwrsave(sc);
|
rge_disable_phy_ocp_pwrsave(sc);
|
||||||
|
|
||||||
/* Set PCIe uncorrectable error status. */
|
/* Set PCIe uncorrectable error status. */
|
||||||
|
@ -1951,6 +2279,12 @@ rge_add_media_types(struct rge_softc *sc)
|
||||||
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
|
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL);
|
||||||
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_2500_T, 0, NULL);
|
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_2500_T, 0, NULL);
|
||||||
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_2500_T | IFM_FDX, 0, NULL);
|
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_2500_T | IFM_FDX, 0, NULL);
|
||||||
|
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126) {
|
||||||
|
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_5000_T, 0, NULL);
|
||||||
|
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_5000_T | IFM_FDX,
|
||||||
|
0, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1972,6 +2306,9 @@ void
|
||||||
rge_disable_aspm_clkreq(struct rge_softc *sc)
|
rge_disable_aspm_clkreq(struct rge_softc *sc)
|
||||||
{
|
{
|
||||||
RGE_SETBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
|
RGE_SETBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
|
||||||
|
if (sc->rge_type == MAC_CFG2_8126)
|
||||||
|
RGE_CLRBIT_1(sc, RGE_INT_CFG0, 0x08);
|
||||||
|
else
|
||||||
RGE_CLRBIT_1(sc, RGE_CFG2, RGE_CFG2_CLKREQ_EN);
|
RGE_CLRBIT_1(sc, RGE_CFG2, RGE_CFG2_CLKREQ_EN);
|
||||||
RGE_CLRBIT_1(sc, RGE_CFG5, RGE_CFG5_PME_STS);
|
RGE_CLRBIT_1(sc, RGE_CFG5, RGE_CFG5_PME_STS);
|
||||||
RGE_CLRBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
|
RGE_CLRBIT_1(sc, RGE_EECMD, RGE_EECMD_WRITECFG);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
||||||
$OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp $
|
$OpenBSD: pcidevs,v 1.2078 2024/06/30 08:11:36 kevlo Exp $
|
||||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8776,6 +8776,7 @@ product REALTEK RTL8411 0x5289 RTL8411 Card Reader
|
||||||
product REALTEK RT8029 0x8029 8029
|
product REALTEK RT8029 0x8029 8029
|
||||||
product REALTEK RT8139D 0x8039 8139D
|
product REALTEK RT8139D 0x8039 8139D
|
||||||
product REALTEK RTL8125 0x8125 RTL8125
|
product REALTEK RTL8125 0x8125 RTL8125
|
||||||
|
product REALTEK RTL8126 0x8126 RTL8126
|
||||||
product REALTEK RT8129 0x8129 8129
|
product REALTEK RT8129 0x8129 8129
|
||||||
product REALTEK RT8101E 0x8136 8101E
|
product REALTEK RT8101E 0x8136 8101E
|
||||||
product REALTEK RT8138 0x8138 8138
|
product REALTEK RT8138 0x8138 8138
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||||
*
|
*
|
||||||
* generated from:
|
* generated from:
|
||||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
* OpenBSD: pcidevs,v 1.2078 2024/06/30 08:11:36 kevlo Exp
|
||||||
*/
|
*/
|
||||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||||
|
|
||||||
|
@ -8781,6 +8781,7 @@
|
||||||
#define PCI_PRODUCT_REALTEK_RT8029 0x8029 /* 8029 */
|
#define PCI_PRODUCT_REALTEK_RT8029 0x8029 /* 8029 */
|
||||||
#define PCI_PRODUCT_REALTEK_RT8139D 0x8039 /* 8139D */
|
#define PCI_PRODUCT_REALTEK_RT8139D 0x8039 /* 8139D */
|
||||||
#define PCI_PRODUCT_REALTEK_RTL8125 0x8125 /* RTL8125 */
|
#define PCI_PRODUCT_REALTEK_RTL8125 0x8125 /* RTL8125 */
|
||||||
|
#define PCI_PRODUCT_REALTEK_RTL8126 0x8126 /* RTL8126 */
|
||||||
#define PCI_PRODUCT_REALTEK_RT8129 0x8129 /* 8129 */
|
#define PCI_PRODUCT_REALTEK_RT8129 0x8129 /* 8129 */
|
||||||
#define PCI_PRODUCT_REALTEK_RT8101E 0x8136 /* 8101E */
|
#define PCI_PRODUCT_REALTEK_RT8101E 0x8136 /* 8101E */
|
||||||
#define PCI_PRODUCT_REALTEK_RT8138 0x8138 /* 8138 */
|
#define PCI_PRODUCT_REALTEK_RT8138 0x8138 /* 8138 */
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||||
*
|
*
|
||||||
* generated from:
|
* generated from:
|
||||||
* OpenBSD: pcidevs,v 1.2077 2024/06/16 16:20:51 kn Exp
|
* OpenBSD: pcidevs,v 1.2078 2024/06/30 08:11:36 kevlo Exp
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
|
||||||
|
@ -31667,6 +31667,10 @@ static const struct pci_known_product pci_known_products[] = {
|
||||||
PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8125,
|
PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8125,
|
||||||
"RTL8125",
|
"RTL8125",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RTL8126,
|
||||||
|
"RTL8126",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129,
|
PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8129,
|
||||||
"8129",
|
"8129",
|
||||||
|
|
|
@ -305,9 +305,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid block type";
|
strm->msg = (z_const char *)"invalid block type";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
}
|
}
|
||||||
|
@ -320,9 +320,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid stored block lengths";
|
strm->msg = (z_const char *)"invalid stored block lengths";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -362,9 +362,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"too many length or distance symbols";
|
strm->msg = (z_const char *)"too many length or distance symbols";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -388,9 +388,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code lengths set";
|
strm->msg = (z_const char *)"invalid code lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -415,9 +415,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -442,9 +442,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -460,9 +460,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
/* check for end-of-block code (better have one) */
|
/* check for end-of-block code (better have one) */
|
||||||
if (state->lens[256] == 0) {
|
if (state->lens[256] == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code -- missing end-of-block";
|
strm->msg = (z_const char *)"invalid code -- missing end-of-block";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -478,9 +478,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/lengths set";
|
strm->msg = (z_const char *)"invalid literal/lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -491,9 +491,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distances set";
|
strm->msg = (z_const char *)"invalid distances set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -556,9 +556,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
/* invalid code */
|
/* invalid code */
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -592,9 +592,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -611,9 +611,9 @@ int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
|
||||||
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
||||||
left : 0)) {
|
left : 0)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -155,7 +155,7 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
dist += (unsigned)hold & ((1U << op) - 1);
|
dist += (unsigned)hold & ((1U << op) - 1);
|
||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (dist > dmax) {
|
if (dist > dmax) {
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -169,10 +169,10 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
if (op > whave) {
|
if (op > whave) {
|
||||||
if (state->sane) {
|
if (state->sane) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg =
|
strm->msg =
|
||||||
(char *)"invalid distance too far back";
|
(z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -270,9 +270,9 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -289,9 +289,9 @@ void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -643,18 +643,18 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#endif
|
#endif
|
||||||
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect header check";
|
strm->msg = (z_const char *)"incorrect header check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (BITS(4) != Z_DEFLATED) {
|
if (BITS(4) != Z_DEFLATED) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown compression method";
|
strm->msg = (z_const char *)"unknown compression method";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -665,9 +665,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->wbits = len;
|
state->wbits = len;
|
||||||
if (len > 15 || len > state->wbits) {
|
if (len > 15 || len > state->wbits) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid window size";
|
strm->msg = (z_const char *)"invalid window size";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -685,18 +685,18 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->flags = (int)(hold);
|
state->flags = (int)(hold);
|
||||||
if ((state->flags & 0xff) != Z_DEFLATED) {
|
if ((state->flags & 0xff) != Z_DEFLATED) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown compression method";
|
strm->msg = (z_const char *)"unknown compression method";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (state->flags & 0xe000) {
|
if (state->flags & 0xe000) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"unknown header flags set";
|
strm->msg = (z_const char *)"unknown header flags set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -814,9 +814,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
|
if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"header crc mismatch";
|
strm->msg = (z_const char *)"header crc mismatch";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -880,9 +880,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid block type";
|
strm->msg = (z_const char *)"invalid block type";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
}
|
}
|
||||||
|
@ -893,9 +893,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid stored block lengths";
|
strm->msg = (z_const char *)"invalid stored block lengths";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -938,9 +938,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"too many length or distance symbols";
|
strm->msg = (z_const char *)"too many length or distance symbols";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -965,9 +965,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code lengths set";
|
strm->msg = (z_const char *)"invalid code lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -993,9 +993,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
DROPBITS(here.bits);
|
DROPBITS(here.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1020,9 +1020,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid bit length repeat";
|
strm->msg = (z_const char *)"invalid bit length repeat";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1038,9 +1038,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
/* check for end-of-block code (better have one) */
|
/* check for end-of-block code (better have one) */
|
||||||
if (state->lens[256] == 0) {
|
if (state->lens[256] == 0) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid code -- missing end-of-block";
|
strm->msg = (z_const char *)"invalid code -- missing end-of-block";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1056,9 +1056,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/lengths set";
|
strm->msg = (z_const char *)"invalid literal/lengths set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1069,9 +1069,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distances set";
|
strm->msg = (z_const char *)"invalid distances set";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1129,9 +1129,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
}
|
}
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid literal/length code";
|
strm->msg = (z_const char *)"invalid literal/length code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1171,9 +1171,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
state->back += here.bits;
|
state->back += here.bits;
|
||||||
if (here.op & 64) {
|
if (here.op & 64) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance code";
|
strm->msg = (z_const char *)"invalid distance code";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1192,9 +1192,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (state->offset > state->dmax) {
|
if (state->offset > state->dmax) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1211,9 +1211,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
if (copy > state->whave) {
|
if (copy > state->whave) {
|
||||||
if (state->sane) {
|
if (state->sane) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (z_const char *)"invalid distance too far back";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1274,9 +1274,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
#endif
|
#endif
|
||||||
ZSWAP32(hold)) != state->check) {
|
ZSWAP32(hold)) != state->check) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect data check";
|
strm->msg = (z_const char *)"incorrect data check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
@ -1292,9 +1292,9 @@ int ZEXPORT inflate(z_streamp strm, int flush) {
|
||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
|
||||||
#ifdef SMALL
|
#ifdef SMALL
|
||||||
strm->msg = "error";
|
strm->msg = (z_const char *)"error";
|
||||||
#else
|
#else
|
||||||
strm->msg = (char *)"incorrect length check";
|
strm->msg = (z_const char *)"incorrect length check";
|
||||||
#endif
|
#endif
|
||||||
state->mode = BAD;
|
state->mode = BAD;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -597,11 +597,11 @@ ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
|
||||||
Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
|
Z_RLE is almost as fast as Z_HUFFMAN_ONLY, but should give better
|
||||||
compression for PNG image data than Huffman only. The degree of string
|
compression for PNG image data than Huffman only. The degree of string
|
||||||
matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
|
matching from most to none is: Z_DEFAULT_STRATEGY, Z_FILTERED, Z_RLE, then
|
||||||
Z_HUFFMAN. The strategy parameter affects the compression ratio but never
|
Z_HUFFMAN_ONLY. The strategy parameter affects the compression ratio but
|
||||||
the correctness of the compressed output, even if it is not set optimally
|
never the correctness of the compressed output, even if it is not set
|
||||||
for the given data. Z_FIXED uses the default string matching, but prevents
|
optimally for the given data. Z_FIXED uses the default string matching, but
|
||||||
the use of dynamic Huffman codes, allowing for a simpler decoder for special
|
prevents the use of dynamic Huffman codes, allowing for a simpler decoder
|
||||||
applications.
|
for special applications.
|
||||||
|
|
||||||
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||||
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
|
memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: kdump.c,v 1.163 2024/05/18 05:20:22 guenther Exp $ */
|
/* $OpenBSD: kdump.c,v 1.164 2024/06/29 11:32:35 jsg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1988, 1993
|
* Copyright (c) 1988, 1993
|
||||||
|
@ -1499,9 +1499,6 @@ ktrpledge(struct ktr_pledge *pledge, size_t len)
|
||||||
static void
|
static void
|
||||||
ktrpinsyscall(struct ktr_pinsyscall *pinsyscall, size_t len)
|
ktrpinsyscall(struct ktr_pinsyscall *pinsyscall, size_t len)
|
||||||
{
|
{
|
||||||
const char *name = "";
|
|
||||||
int i;
|
|
||||||
|
|
||||||
if (len < sizeof(struct ktr_pinsyscall))
|
if (len < sizeof(struct ktr_pinsyscall))
|
||||||
errx(1, "invalid ktr pinsyscall length %zu", len);
|
errx(1, "invalid ktr pinsyscall length %zu", len);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: syslogd.c,v 1.280 2024/01/06 19:34:54 bluhm Exp $ */
|
/* $OpenBSD: syslogd.c,v 1.281 2024/06/29 11:29:55 jsg Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2021 Alexander Bluhm <bluhm@genua.de>
|
* Copyright (c) 2014-2021 Alexander Bluhm <bluhm@genua.de>
|
||||||
|
@ -1582,7 +1582,6 @@ void
|
||||||
udp_resolvecb(int fd, short event, void *arg)
|
udp_resolvecb(int fd, short event, void *arg)
|
||||||
{
|
{
|
||||||
struct filed *f = arg;
|
struct filed *f = arg;
|
||||||
struct timeval to;
|
|
||||||
|
|
||||||
if (loghost_resolve(f) != 0) {
|
if (loghost_resolve(f) != 0) {
|
||||||
loghost_retry(f);
|
loghost_retry(f);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue