Re: Cleanup meta tags

2015-07-01 Thread Anthony J. Bentley
Pavel Plamenov writes:
> Updated patch.

Thanks, I've reviewed and committed this. Your mailer is still adding
extra whitespace to the patch, though... please figure out why that's
happening and fix it.



[patch] armv7 option SDHC_DEBUG support

2015-07-01 Thread ian kremlin
Hi

Compiling an armv7 kernel with option SDHC_DEBUG fails as there is no definition
of the ommmc_dump_regs function, so add it.

Tested on real hardware (Beaglebone Black):

ommmc0 at omap0
ommmc0: SYSCONFIG: 0x2015 SYSSTATUS: 0x0001  CSRE: 0x
ommmc0:   SYSTEST: 0x   CON: 0x0600 PWCNT: 0x
ommmc0:   BLK: 0x   ARG: 0x   CMD: 0x
ommmc0: RSP10: 0x RSP32: 0x RSP54: 0x
ommmc0: RSP76: 0x  DATA: 0xPSTATE: 0x01f7
ommmc0:  HCTL: 0xSYSCTL: 0x  STAT: 0x0040
ommmc0:IE: 0x   ISE: 0x  AC12: 0x
ommmc0:  CAPA: 0x06e10080  CUR_CAPA: 0x   REV: 0x3101
ommmc0: software reset reg=0x100
sdmmc0 at ommmc0

This will help figure out why the onboard eMMC flash memory isn't being
configured properly on later BBB revisions where they bumped it from 2GB -> 4GB.

Ian

Index: ommmc.c
===
RCS file: /cvs/src/sys/arch/armv7/omap/ommmc.c,v
retrieving revision 1.14
diff -u -p -r1.14 ommmc.c
--- ommmc.c 30 May 2015 02:17:36 - 1.14
+++ ommmc.c 2 Jul 2015 01:48:32 -
@@ -244,7 +244,41 @@ void ommmc_write_data(struct ommmc_softc
 #ifdef SDHC_DEBUG
 int ommmcdebug = 20;
 #define DPRINTF(n,s) do { if ((n) <= ommmcdebug) printf s; } while (0)
-void ommmc_dump_regs(struct ommmc_softc *);
+void
+ommmc_dump_regs(struct ommmc_softc *sc)
+{
+ DPRINTF(3,("%s: SYSCONFIG: 0x%08x SYSSTATUS: 0x%08x  CSRE: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_SYSCONFIG), HREAD4(sc, MMCHS_SYSSTATUS),
+HREAD4(sc, MMCHS_CSRE)));
+
+ DPRINTF(3,("%s:   SYSTEST: 0x%08x   CON: 0x%08x PWCNT: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_SYSTEST), HREAD4(sc, MMCHS_CON),
+HREAD4(sc, MMCHS_PWCNT)));
+
+ DPRINTF(3,("%s:   BLK: 0x%08x   ARG: 0x%08x   CMD: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_BLK), HREAD4(sc, MMCHS_ARG),
+HREAD4(sc, MMCHS_CMD)));
+
+ DPRINTF(3,("%s: RSP10: 0x%08x RSP32: 0x%08x RSP54: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_RSP10), HREAD4(sc, MMCHS_RSP32),
+HREAD4(sc, MMCHS_RSP54)));
+
+ DPRINTF(3,("%s: RSP76: 0x%08x  DATA: 0x%08xPSTATE: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_RSP76), HREAD4(sc, MMCHS_DATA),
+HREAD4(sc, MMCHS_PSTATE)));
+
+ DPRINTF(3,("%s:  HCTL: 0x%08xSYSCTL: 0x%08x  STAT: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_HCTL), HREAD4(sc, MMCHS_SYSCTL),
+HREAD4(sc, MMCHS_STAT)));
+
+ DPRINTF(3,("%s:IE: 0x%08x   ISE: 0x%08x  AC12: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_IE), HREAD4(sc, MMCHS_ISE),
+HREAD4(sc, MMCHS_AC12)));
+
+ DPRINTF(3,("%s:  CAPA: 0x%08x  CUR_CAPA: 0x%08x   REV: 0x%08x\n",
+DEVNAME(sc), HREAD4(sc, MMCHS_CAPA), HREAD4(sc, MMCHS_CUR_CAPA),
+HREAD4(sc, MMCHS_REV)));
+}
 #else
 #define DPRINTF(n,s) do {} while(0)
 #endif



Re: fix build with SCSIDEBUG

2015-07-01 Thread frantisek holop
Miod Vallat, 01 Jul 2015 21:35:
> > spoke to soon, other anciet drivers need something like
> > that.
> 
> Physical address should be printed with %p rather than 0x%x.

explicit cast ok?

-f
-- 
why did kamikaze pilots wear helmets anyway?
Index: dev/eisa/aha1742.c
===
RCS file: /cvs/src/sys/dev/eisa/aha1742.c,v
retrieving revision 1.44
diff -u -p -r1.44 aha1742.c
--- dev/eisa/aha1742.c  14 Sep 2014 14:17:24 -  1.44
+++ dev/eisa/aha1742.c  1 Jul 2015 22:21:35 -
@@ -957,7 +957,7 @@ ahb_scsi_cmd(xs)
 * Set up the scatter gather block
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @%p:- ", xs->datalen, (void *)xs->data));
datalen = xs->datalen;
thiskv = (long) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -968,7 +968,7 @@ ahb_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("%p", (void *)thisphys));
 
/* do it at least once */
nextphys = thisphys;
Index: dev/ic/uha.c
===
RCS file: /cvs/src/sys/dev/ic/uha.c,v
retrieving revision 1.24
diff -u -p -r1.24 uha.c
--- dev/ic/uha.c14 Sep 2014 14:17:25 -  1.24
+++ dev/ic/uha.c1 Jul 2015 22:21:35 -
@@ -358,7 +358,7 @@ uha_scsi_cmd(xs)
 * Set up the scatter gather block
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @%p:- ", xs->datalen, (void *)xs->data));
datalen = xs->datalen;
thiskv = (int) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -369,7 +369,7 @@ uha_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("%p", (void *)thisphys));
 
/* do it at least once */
nextphys = thisphys;
Index: dev/isa/wds.c
===
RCS file: /cvs/src/sys/dev/isa/wds.c,v
retrieving revision 1.42
diff -u -p -r1.42 wds.c
--- dev/isa/wds.c   14 Sep 2014 14:17:25 -  1.42
+++ dev/isa/wds.c   1 Jul 2015 22:21:35 -
@@ -931,7 +931,7 @@ wds_scsi_cmd(struct scsi_xfer *xs)
 * Set up the scatter-gather block.
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @%p:- ", xs->datalen, (void *)xs->data));
 
datalen = xs->datalen;
thiskv = (int)xs->data;
@@ -943,7 +943,7 @@ wds_scsi_cmd(struct scsi_xfer *xs)
/* put in the base address */
ltophys(thisphys, sg->seg_addr);
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("%p", (void *)thisphys));
 
/* do it at least once */
nextphys = thisphys;


Re: fix build with SCSIDEBUG

2015-07-01 Thread Miod Vallat
> spoke to soon, other anciet drivers need something like
> that.

Physical address should be printed with %p rather than 0x%x.



Re: fix build with SCSIDEBUG

2015-07-01 Thread frantisek holop
spoke to soon, other anciet drivers need something like
that.

-f
-- 
experience is nothing but a lot of mistakes.
Index: dev/eisa/aha1742.c
===
RCS file: /cvs/src/sys/dev/eisa/aha1742.c,v
retrieving revision 1.44
diff -u -p -r1.44 aha1742.c
--- dev/eisa/aha1742.c  14 Sep 2014 14:17:24 -  1.44
+++ dev/eisa/aha1742.c  1 Jul 2015 21:29:52 -
@@ -957,7 +957,7 @@ ahb_scsi_cmd(xs)
 * Set up the scatter gather block
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @0x%x:- ", xs->datalen, (u_int32_t)xs->data));
datalen = xs->datalen;
thiskv = (long) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -968,7 +968,7 @@ ahb_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", 
(u_int32_t)thisphys));
 
/* do it at least once */
nextphys = thisphys;
Index: dev/ic/uha.c
===
RCS file: /cvs/src/sys/dev/ic/uha.c,v
retrieving revision 1.24
diff -u -p -r1.24 uha.c
--- dev/ic/uha.c14 Sep 2014 14:17:25 -  1.24
+++ dev/ic/uha.c1 Jul 2015 21:29:52 -
@@ -358,7 +358,7 @@ uha_scsi_cmd(xs)
 * Set up the scatter gather block
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @0x%x:- ", xs->datalen, (u_int32_t)xs->data));
datalen = xs->datalen;
thiskv = (int) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -369,7 +369,7 @@ uha_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", 
(u_int32_t)thisphys));
 
/* do it at least once */
nextphys = thisphys;
Index: dev/isa/wds.c
===
RCS file: /cvs/src/sys/dev/isa/wds.c,v
retrieving revision 1.42
diff -u -p -r1.42 wds.c
--- dev/isa/wds.c   14 Sep 2014 14:17:25 -  1.42
+++ dev/isa/wds.c   1 Jul 2015 21:29:52 -
@@ -931,7 +931,7 @@ wds_scsi_cmd(struct scsi_xfer *xs)
 * Set up the scatter-gather block.
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @0x%x:- ", xs->datalen, (u_int32_t)xs->data));
 
datalen = xs->datalen;
thiskv = (int)xs->data;
@@ -943,7 +943,7 @@ wds_scsi_cmd(struct scsi_xfer *xs)
/* put in the base address */
ltophys(thisphys, sg->seg_addr);
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", 
(u_int32_t)thisphys));
 
/* do it at least once */
nextphys = thisphys;


ifconfig gre patch

2015-07-01 Thread Alexander Salmin
I recently noticed work was done on ifconfig gre, --> was replaced by 
->, would it be ok to change other --> too? (patch attached)


Alexander
? gre-dash-diff.diff
Index: ifconfig.c
===
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.296
diff -r1.296 ifconfig.c
3100c3100
< 		printf(" --> %s", inet_ntoa(sin->sin_addr));
---
> 		printf(" -> %s", inet_ntoa(sin->sin_addr));


fix build with SCSIDEBUG

2015-07-01 Thread frantisek holop
i needed something like this to build a kernel with -DSCSIDEBUG

-f
-- 
the next sentence is true.  the last sentence was false.
Index: uha.c
===
RCS file: /cvs/src/sys/dev/ic/uha.c,v
retrieving revision 1.24
diff -u -p -r1.24 uha.c
--- uha.c   14 Sep 2014 14:17:25 -  1.24
+++ uha.c   1 Jul 2015 21:09:13 -
@@ -358,7 +358,7 @@ uha_scsi_cmd(xs)
 * Set up the scatter gather block
 */
SC_DEBUG(sc_link, SDEV_DB4,
-   ("%d @0x%x:- ", xs->datalen, xs->data));
+   ("%d @0x%x:- ", xs->datalen, (u_int32_t)xs->data));
datalen = xs->datalen;
thiskv = (int) xs->data;
thisphys = KVTOPHYS(thiskv);
@@ -369,7 +369,7 @@ uha_scsi_cmd(xs)
/* put in the base address */
sg->seg_addr = thisphys;
 
-   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", thisphys));
+   SC_DEBUGN(sc_link, SDEV_DB4, ("0x%x", 
(u_int32_t)thisphys));
 
/* do it at least once */
nextphys = thisphys;


[patch] urtwn(4) hostap mode support for 8188eu

2015-07-01 Thread Mikhail
Hello, inlined patch adds support for hostap mode for 8188eu chip.

One known issue is documented in urtwn(4), I would like to know if
people with other hw will see it too, or if it's my local issue.

If you want to help, please test the patch and in case of problems
provide as much as you can from this list:

 - commands with which you started the AP
 - dmesg | grep urtwn
 - ifconfig 
 - tcpdump -i urtwn0 -y IEEE802_11 -w test.pcap (command must be run on
   the AP before problem occurs; I assume mailing the file to maillist
   isn't appropriate, so mail it to me directly)
 - if you can - sniff from the client (or, ideally, from third PC) too,
   since previous command won't give radiotap headers and won't show
   beacons.

Patch has been tested with tl-wn725n, and mac mini as a client, running
802.11g and wpa2, speed is about 3-4 mbits in presence of ~20 ssids.
Also, usual client mode with 8188eu chip is confirmed to work as before.

Since the patch touches some bits in STA mode initialization, it would
be helpful, if people with non-8188eu chip test it too in usual client
mode.

Any feedback and advice are appreciated.

diff --git share/man/man4/urtwn.4 share/man/man4/urtwn.4
index d2007a7..00928d4 100644
--- share/man/man4/urtwn.4
+++ share/man/man4/urtwn.4
@@ -58,6 +58,8 @@ capture packets from networks which it wouldn't normally have 
access to,
 or to scan for access points.
 .El
 .Pp
+The RTL8188EUS chip can also operate in Host AP mode.
+.Pp
 The
 .Nm
 driver can be configured to use
@@ -180,3 +182,8 @@ adapters.
 Additional work is required in
 .Xr ieee80211 9
 before those features can be supported.
+.Pp
+Beacon transmission, when operating in Host AP mode, is not started
+immidiatelly, but with timeout of around 40 seconds, it means that if you
+associate within this time frame, your client card will eventually disconnect
+you, assuming that you've left range of AP.
diff --git sys/dev/usb/if_urtwn.c sys/dev/usb/if_urtwn.c
index db47398..18a4200 100644
--- sys/dev/usb/if_urtwn.c
+++ sys/dev/usb/if_urtwn.c
@@ -216,6 +216,7 @@ voidurtwn_rxeof(struct usbd_xfer *, void *,
usbd_status);
 void   urtwn_txeof(struct usbd_xfer *, void *,
usbd_status);
+inturtwn_txbcn(struct urtwn_softc *, struct ieee80211_node *);
 inturtwn_tx(struct urtwn_softc *, struct mbuf *,
struct ieee80211_node *);
 void   urtwn_start(struct ifnet *);
@@ -347,6 +348,11 @@ urtwn_attach(struct device *parent, struct device *self, 
void *aux)
IEEE80211_C_WEP |   /* WEP. */
IEEE80211_C_RSN;/* WPA/RSN. */
 
+#ifndef IEEE80211_STA_ONLY
+   if (sc->chip & URTWN_CHIP_88E)
+   ic->ic_caps |= IEEE80211_C_HOSTAP; /* HostAp mode supported */
+#endif
+
 #ifndef IEEE80211_NO_HT
/* Set HT capabilities. */
ic->ic_htcaps =
@@ -1319,7 +1325,7 @@ urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
struct ieee80211_node *ni;
enum ieee80211_state ostate;
uint32_t reg;
-   int s;
+   int s, error;
 
s = splnet();
ostate = ic->ic_state;
@@ -1422,22 +1428,62 @@ urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
}
ni = ic->ic_bss;
 
-   /* Set media status to 'Associated'. */
-   reg = urtwn_read_4(sc, R92C_CR);
-   reg = RW(reg, R92C_CR_NETTYPE, R92C_CR_NETTYPE_INFRA);
-   urtwn_write_4(sc, R92C_CR, reg);
+   if (ic->ic_opmode == IEEE80211_M_STA) {
+   /* Set BSSID. */
+   urtwn_write_4(sc, R92C_BSSID + 0, 
LE_READ_4(&ni->ni_bssid[0]));
+   urtwn_write_4(sc, R92C_BSSID + 4, 
LE_READ_2(&ni->ni_bssid[4]));
 
-   /* Set BSSID. */
-   urtwn_write_4(sc, R92C_BSSID + 0, LE_READ_4(&ni->ni_bssid[0]));
-   urtwn_write_4(sc, R92C_BSSID + 4, LE_READ_2(&ni->ni_bssid[4]));
+   if (ic->ic_curmode == IEEE80211_MODE_11B)
+   urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 0);
+   else/* 802.11b/g */
+   urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 3);
 
-   if (ic->ic_curmode == IEEE80211_MODE_11B)
-   urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 0);
-   else/* 802.11b/g */
-   urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 3);
+   /* Enable Rx of data frames. */
+   urtwn_write_2(sc, R92C_RXFLTMAP2, 0x);
 
-   /* Enable Rx of data frames. */
-   urtwn_write_2(sc, R92C_RXFLTMAP2, 0x);
+   /* Allow Rx from our BSSID only. */
+   urtwn_write_4(sc, R92C_RCR, urtwn_read_4(sc, R92C_RCR) |
+   R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN);
+
+   /* Set media sta

Re: error:0906D064:PEM routines:PEM_read_bio:bad base64

2015-07-01 Thread mxb

OpenSSL 1.0.1o on OpenBSD-current does not have problem with this key as well.


> On 30 jun 2015, at 08:52, mxb  wrote:
> 
> 
> I’m sorry but I can’t provide private key. 
> It is basically production and not self-signed. Comes from Thawte.
> 
> I’m able to produce output from ‘openssl enc -d base64 < key’, 
> so issue from the link you pointed out is not on my side.
> 
> I’m following OpenBSD-current by moving from snap to snap.
> I just actually started to deploy SSL acceleration with relayd, so I’m not 
> aware on
> any prev. working snap. I had older snap which produced this issue, so I 
> moved to
> up-to-date -CURRENT.
> 
> Linux dist which working is FC20, with 'OpenSSL 1.0.1e-fips 11 Feb 2013’.
> I have 3 more key/cert pairs from Thawte. Those are OK both on FC20 and 
> OpenBSD-current.
> 
> Question how do I debug this?
> I’m happy to apply any patches for testing.
> 
> Br
> //mxb
> 
>> On 30 jun 2015, at 05:25, Brent Cook  wrote:
>> 
>> On Mon, Jun 29, 2015 at 1:22 AM, mxb  wrote:
>>> Hey,
>>> 
>>> getting following error on OpenBSD-current as of yesterdays 'cvs up’:
>> 
>> Does this imply that it worked in some earlier version of
>> OpenBSD-current? If so, what was the version that worked?
>> 
>>> unable to load Private Key
>>> 30008934842236:error:0906D064:PEM routines:PEM_read_bio:bad base64 
>>> decode:/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/pem/pem_lib.c:822:
>>> 
>>> Cmd issued: 'openssl rsa -noout -modulus -in key’
>>> 
>>> ‘openssl version’: LibreSSL 2.2
>>> 
>>> This key is OK with openssl on Linux
>> 
>> It's probably silly to ask for a copy of your private key, but could
>> you share an example of the input that is failing here? Maybe if you
>> can generate a new pem file?
>> 
>> I seem to recall an actually invalid base64 encoding issue that was
>> reported last year. Does this seem relevant?
>> 
>> http://tech.openbsd.narkive.com/tHdomkKq/libressl-base64-decoding-error
>> 
>> Saying 'openssl on Linux' doesn't help us much (especially without a
>> sample of the input), though something like 'OpenSSL 1.0.1e on Ubuntu
>> 14.04' might if we had something to test against.
>> 
>>> Br
>>> 
>>> //mxb
>>> 
>>> 
> 




unify vlan and svlan tag hashes

2015-07-01 Thread David Gwynne
tag lookups consider the type of interface as well as its tag, so
it isnt necessary to have separate hashes for vlans and svlans.

following on from this, i would like to widen the tag hash and maybe
xor some more bits in to get the key. vlan tags are 12 bits, so the
following appeals to me:

#define TAG_HASH_SIZE   64
#define TAG_HASH(tag)   ((tag & vlan_tagmask) ^ ((tag >> 6) & vlan_tagmask))

it would also be nice to have vlan interfaces refer to their parents
by interface indexes instead of actual pointers. that would allow
the hash lookup to be done without necessarily calling if_get in
vlan_input, but that would also require not accounting errors on
the parent interface.

anyway.

tests?

Index: if_vlan.c
===
RCS file: /cvs/src/sys/net/if_vlan.c,v
retrieving revision 1.132
diff -u -p -r1.132 if_vlan.c
--- if_vlan.c   29 Jun 2015 10:32:29 -  1.132
+++ if_vlan.c   1 Jul 2015 07:26:18 -
@@ -74,7 +74,7 @@ u_long vlan_tagmask, svlan_tagmask;
 
 #define TAG_HASH_SIZE  32
 #define TAG_HASH(tag)  (tag & vlan_tagmask)
-LIST_HEAD(vlan_taghash, ifvlan)*vlan_tagh, *svlan_tagh;
+LIST_HEAD(vlan_taghash, ifvlan)*vlan_tagh;
 
 
 intvlan_input(struct mbuf *);
@@ -102,18 +102,15 @@ struct if_clone svlan_cloner =
 void
 vlanattach(int count)
 {
-   /* Normal VLAN */
vlan_tagh = hashinit(TAG_HASH_SIZE, M_DEVBUF, M_NOWAIT,
&vlan_tagmask);
if (vlan_tagh == NULL)
panic("vlanattach: hashinit");
+
+   /* Normal VLAN */
if_clone_attach(&vlan_cloner);
 
/* Service-VLAN for QinQ/802.1ad provider bridges */
-   svlan_tagh = hashinit(TAG_HASH_SIZE, M_DEVBUF, M_NOWAIT,
-   &svlan_tagmask);
-   if (svlan_tagh == NULL)
-   panic("vlanattach: hashinit");
if_clone_attach(&svlan_cloner);
 }
 
@@ -249,7 +246,6 @@ vlan_input(struct mbuf *m)
struct ifnet*ifp;
struct ether_vlan_header*evl;
struct ether_header *eh;
-   struct vlan_taghash *tagh;
u_inttag;
struct mbuf_list ml = MBUF_LIST_INITIALIZER();
u_int16_tetype;
@@ -266,7 +262,6 @@ vlan_input(struct mbuf *m)
 
if (m->m_flags & M_VLANTAG) {
etype = ETHERTYPE_VLAN;
-   tagh = vlan_tagh;
} else if ((etype == ETHERTYPE_VLAN) || (etype == ETHERTYPE_QINQ)) {
if (m->m_len < EVL_ENCAPLEN &&
(m = m_pullup(m, EVL_ENCAPLEN)) == NULL) {
@@ -276,7 +271,6 @@ vlan_input(struct mbuf *m)
 
evl = mtod(m, struct ether_vlan_header *);
m->m_pkthdr.ether_vtag = ntohs(evl->evl_tag);
-   tagh = etype == ETHERTYPE_QINQ ? svlan_tagh : vlan_tagh;
} else {
/* Skip non-VLAN packets. */
return (0);
@@ -290,7 +284,7 @@ vlan_input(struct mbuf *m)
if (m->m_pkthdr.pf.prio <= 1)
m->m_pkthdr.pf.prio = !m->m_pkthdr.pf.prio;
 
-   LIST_FOREACH(ifv, &tagh[TAG_HASH(tag)], ifv_list) {
+   LIST_FOREACH(ifv, &vlan_tagh[TAG_HASH(tag)], ifv_list) {
if (ifp == ifv->ifv_p && tag == ifv->ifv_tag &&
etype == ifv->ifv_type)
break;
@@ -344,7 +338,6 @@ int
 vlan_config(struct ifvlan *ifv, struct ifnet *p, u_int16_t tag)
 {
struct sockaddr_dl  *sdl1, *sdl2;
-   struct vlan_taghash *tagh;
u_intflags;
int  s;
 
@@ -429,14 +422,12 @@ vlan_config(struct ifvlan *ifv, struct i
 
vlan_vlandev_state(ifv);
 
-   tagh = ifv->ifv_type == ETHERTYPE_QINQ ? svlan_tagh : vlan_tagh;
-
s = splnet();
/* Change input handler of the physical interface. */
if (++ifv->ifv_ifih->ifih_refcnt == 1)
SLIST_INSERT_HEAD(&p->if_inputs, ifv->ifv_ifih, ifih_next);
 
-   LIST_INSERT_HEAD(&tagh[TAG_HASH(tag)], ifv, ifv_list);
+   LIST_INSERT_HEAD(&vlan_tagh[TAG_HASH(tag)], ifv, ifv_list);
splx(s);
 
return (0);