Re: reiser4fs in openbsd

2017-08-25 Thread Dinar Talypov
No code, nothing to discuss.

25 авг. 2017 г. 18:51 пользователь "Victor Kukshiev" <
andrey0bolkon...@gmail.com> написал:

> Reiser4 isn't dead FS, but with advanced features,
>
> 2017-08-25 18:35 GMT+03:00 Daniil Berendeev :
>
> > ok. is reiser4 need on openbsd?
> >>
> > Well, a dead fs is not much of an interest. If you would be porting
> > HAMMER or ZFS (the last one has a painful license though) there
> > probably would be much more interest.
> >
> > --
> > ~Cheers~
> > pipfstarrd.net
> > pipfsta...@jabbim.com
> >
> > PGP KEY ID ACE8 41D8 A1B6 54C0
> > Keys can be retrieved at pgp.mit.edu
> >
>


Re: [patch] fake pv drivers installation on xen

2017-01-18 Thread Dinar Talypov
I use Xenserver 7.0 with xencenter management console.
without it doesn't allow shutdown or reboot.
Anyway I'll try with hostctl.

Thanks.

2017-01-18 21:53 GMT+03:00 Mike Belopuhov <m...@belopuhov.com>:

> On Wed, Jan 18, 2017 at 21:23 +0300, Dinar Talypov wrote:
> > +void
> > +xen_inform_host(struct xen_softc *sc)
> > +{
> > + char *os_name;
> > +
> > + /* Fake PV drivers version */
> > + xs_setnum(sc, "attr/PVAddons", "MajorVersion", 6);
> > + xs_setnum(sc, "attr/PVAddons", "MinorVersion", 2);
> > + xs_setnum(sc, "attr/PVAddons", "MicroVersion", 0);
> > + xs_setnum(sc, "attr/PVAddons", "BuildVersion", 76888);
> > + xs_setnum(sc, "attr/PVAddons", "Installed", 1);
> > +
> > + /* Set OS version */
> > + snprintf(os_name, sizeof((char *)ostype) + sizeof((char
> *)osrelease),
> > + "%s %s", ostype, osrelease);
>
> and btw, here you're corrupting kernel memory since os_name is
> an uninitialized pointer :-)
>


[patch] fake pv drivers installation on xen

2017-01-18 Thread Dinar Talypov

Hi,

The patch below fakes pv drivers installation.
Version numbers are taken from FreeBSD sysutils/xe-guest-utilities.
With this xen allows reboot or shutdown OpenBSD guest.

Index: sys/dev/pv/xen.c
===
RCS file: /cvs/src/sys/dev/pv/xen.c,v
retrieving revision 1.71
diff -u -p -u -r1.71 xen.c
--- sys/dev/pv/xen.c10 Jan 2017 17:16:39 -  1.71
+++ sys/dev/pv/xen.c18 Jan 2017 18:05:27 -
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -75,6 +76,7 @@ void  xen_disable_emulated_devices(struct
 intxen_match(struct device *, void *, void *);
 void   xen_attach(struct device *, struct device *, void *);
 void   xen_deferred(struct device *);
+void   xen_inform_host(struct xen_softc *);
 void   xen_control(void *);
 void   xen_hotplug(void *);
 void   xen_resume(struct device *);
@@ -194,6 +196,29 @@ xen_deferred(struct device *self)
xen_control, sc))
printf("%s: failed to setup shutdown control watch\n",
sc->sc_dev.dv_xname);
+   xen_inform_host(sc);
+}
+void
+xen_inform_host(struct xen_softc *sc)
+{
+   char *os_name;
+   
+   /* Fake PV drivers version */
+   xs_setnum(sc, "attr/PVAddons", "MajorVersion", 6);
+   xs_setnum(sc, "attr/PVAddons", "MinorVersion", 2);
+   xs_setnum(sc, "attr/PVAddons", "MicroVersion", 0);
+   xs_setnum(sc, "attr/PVAddons", "BuildVersion", 76888);
+   xs_setnum(sc, "attr/PVAddons", "Installed", 1);
+
+   /* Set OS version */
+   snprintf(os_name, sizeof((char *)ostype) + sizeof((char *)osrelease),
+   "%s %s", ostype, osrelease);
+   xs_setprop(sc, "data", "os_name", (char *)os_name, strlen(os_name));
+   xs_setprop(sc, "data", "os_uname", (char *)osrelease, 
strlen(osrelease));
+   xs_setprop(sc, "data", "os_distro", (char *)ostype, strlen(ostype));
+
+   /* Update xenstore */
+   xs_setnum(sc, "data", "updated", 1);
 }
 
 void



Re: run(4) firmware update; please test

2014-05-16 Thread Dinar Talypov
Hi,

I have tested with D-Link  DWA-140 rev B2G:

run0 at uhub0 port 1 Ralink 11n Adapter rev 1.10/1.01 addr 2
run0: MAC/BBP RT3071 (rev 0x021C), RF RT3022 (MIMO 2T2R), address
14:d6:4d:49:73:4e

with this diff nothing works. It doesn't find any access point.



2014-05-15 19:32 GMT+04:00 Fred open...@crowsons.com:

 On 05/15/14 10:35, Stefan Sperling wrote:

 This firmware update to version 0.33 is a prequisite for
 newer run(4) devices which are not yet supported.

 Can active users of run(4) devices please test this update
 to make sure no regressions are introduced for already working
 devices? I don't have a supported run(4) device to test with.

   cd /usr/src/sys/dev/microcode/rum  # yes, rum with m
   patch  this-patch
   make obj
   make depend
   sudo make install

 I've obtained permission from Mediatek/Ralink to distribute this
 firmware update under the terms in /etc/firmware/run-license.


 Hi,

 Tested with the at TP-Link TL-WN727N USB Wifi device:

 May 15 13:24:46 x41 /bsd: run0 at uhub0 port 4 Ralink 802.11 n WLAN rev
 2.00/1.01 addr 3
 May 15 13:24:46 x41 /bsd: run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020
 (MIMO 1T1R), address 74:ea:3a:8a:b6:8f

 No regressions with this diff.

 Thanks

 Fred




Re: system freeze with DWL-G520 and possible fix

2013-01-30 Thread Dinar Talypov
Any comments on this?


2013/1/16 Dinar Talypov t.dina...@gmail.com:
 Hi,

 My D-link DWL-G520 card attaches on ath(4):

 ath0 at pci0 dev 9 function 0 Atheros AR5212 rev 0x01: irq 11
 ath0: AR2414 7.9 phy 4.5 rf2413 5.6, FCC2A*, address 00:17:9a:09:f4:5a

 On ifconfig ath0 down  ifconfig ath0 up I've got system freeze.

 Googleing showed that system can freeze on register read or write
 while AR5212 chip in full sleep mode. And it is not possible to wake it up.
 This implies only for some AR5212 chips.

 In linux this is solved by making warm reset, instead
 of putting it in full sleep mode.
 The diff below does the same thing.
 What do you think about it? Or warm_reset function
 must be called only for particular chips?

 Index: ar5212.c
 ===
 RCS file: /cvs/src/sys/dev/ic/ar5212.c,v
 retrieving revision 1.52
 diff -u -r1.52 ar5212.c
 --- ar5212.c14 Oct 2011 17:08:09 -  1.52
 +++ ar5212.c16 Jan 2013 16:58:33 -
 @@ -30,6 +30,7 @@
  u_int16_t   ar5k_ar5212_radio_revision(struct ath_hal *, HAL_CHIP);
  voidar5k_ar5212_fill(struct ath_hal *);
  HAL_BOOLar5k_ar5212_txpower(struct ath_hal *, HAL_CHANNEL *, u_int);
 +HAL_BOOLar5k_ar5212_warm_reset(struct ath_hal *);

  /*
   * Initial register setting for the AR5212
 @@ -2420,6 +2421,44 @@
  }

  /*
 + * Put MAC and Baseband on warm reset and keep that state
 + * (don't clean sleep control register). After this MAC
 + * and Baseband are disabled and a full reset is needed
 + * to come back. This way we save as much power as possible
 + * without putting the card on full sleep.
 + */
 +
 +HAL_BOOL
 +ar5k_ar5212_warm_reset(struct ath_hal *hal)
 +{
 +   u_int32_t flags;
 +
 +   flags = AR5K_AR5212_RC_PCU | AR5K_AR5212_RC_BB;
 +   if (hal-ah_pci_express == AH_FALSE)
 +   flags |= AR5K_AR5212_RC_PCI;
 +
 +   if (ar5k_ar5212_nic_reset(hal, flags) == AH_FALSE) {
 +   AR5K_PRINT(failed to reset the AR5212 + PCI chipset\n);
 +   return (AH_FALSE);
 +   }
 +
 +   /* ...wakeup */
 +   if (ar5k_ar5212_set_power(hal,
 +   HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
 +   AR5K_PRINT(failed to resume the AR5212 (again)\n);
 +   return (AH_FALSE);
 +   }
 +
 +   /* Put chipset on warm reset... */
 +   if (ar5k_ar5212_nic_reset(hal, 0) == AH_FALSE) {
 +   AR5K_PRINT(failed to warm reset the AR5212\n);
 +   return (AH_FALSE);
 +   }
 +
 +   return (AH_TRUE);
 +}
 +
 +/*
   * Power management functions
   */

 @@ -2445,10 +2484,8 @@
 break;

 case HAL_PM_FULL_SLEEP:
 -   if (set_chip == AH_TRUE) {
 -   AR5K_REG_WRITE(AR5K_AR5212_SCR,
 -   AR5K_AR5212_SCR_SLE_SLP);
 -   }
 +   if (set_chip == AH_TRUE)
 +   ar5k_ar5212_warm_reset(hal);
 staid |= AR5K_AR5212_STA_ID1_PWR_SV;
 break;



 --
 Dinar Talypov t.dina...@gmail.com



system freeze with DWL-G520 and possible fix

2013-01-16 Thread Dinar Talypov
Hi,

My D-link DWL-G520 card attaches on ath(4):

ath0 at pci0 dev 9 function 0 Atheros AR5212 rev 0x01: irq 11
ath0: AR2414 7.9 phy 4.5 rf2413 5.6, FCC2A*, address 00:17:9a:09:f4:5a

On ifconfig ath0 down  ifconfig ath0 up I've got system freeze.

Googleing showed that system can freeze on register read or write
while AR5212 chip in full sleep mode. And it is not possible to wake it up.
This implies only for some AR5212 chips.

In linux this is solved by making warm reset, instead 
of putting it in full sleep mode.
The diff below does the same thing.
What do you think about it? Or warm_reset function 
must be called only for particular chips?

Index: ar5212.c
===
RCS file: /cvs/src/sys/dev/ic/ar5212.c,v
retrieving revision 1.52
diff -u -r1.52 ar5212.c
--- ar5212.c14 Oct 2011 17:08:09 -  1.52
+++ ar5212.c16 Jan 2013 16:58:33 -
@@ -30,6 +30,7 @@
 u_int16_t   ar5k_ar5212_radio_revision(struct ath_hal *, HAL_CHIP);
 voidar5k_ar5212_fill(struct ath_hal *);
 HAL_BOOLar5k_ar5212_txpower(struct ath_hal *, HAL_CHANNEL *, u_int);
+HAL_BOOLar5k_ar5212_warm_reset(struct ath_hal *);
 
 /*
  * Initial register setting for the AR5212
@@ -2420,6 +2421,44 @@
 }
 
 /*
+ * Put MAC and Baseband on warm reset and keep that state
+ * (don't clean sleep control register). After this MAC
+ * and Baseband are disabled and a full reset is needed
+ * to come back. This way we save as much power as possible
+ * without putting the card on full sleep.
+ */
+
+HAL_BOOL
+ar5k_ar5212_warm_reset(struct ath_hal *hal)
+{
+   u_int32_t flags;
+
+   flags = AR5K_AR5212_RC_PCU | AR5K_AR5212_RC_BB;
+   if (hal-ah_pci_express == AH_FALSE)
+   flags |= AR5K_AR5212_RC_PCI;
+
+   if (ar5k_ar5212_nic_reset(hal, flags) == AH_FALSE) {
+   AR5K_PRINT(failed to reset the AR5212 + PCI chipset\n);
+   return (AH_FALSE);
+   }
+
+   /* ...wakeup */
+   if (ar5k_ar5212_set_power(hal,
+   HAL_PM_AWAKE, AH_TRUE, 0) == AH_FALSE) {
+   AR5K_PRINT(failed to resume the AR5212 (again)\n);
+   return (AH_FALSE);
+   }
+
+   /* Put chipset on warm reset... */
+   if (ar5k_ar5212_nic_reset(hal, 0) == AH_FALSE) {
+   AR5K_PRINT(failed to warm reset the AR5212\n);
+   return (AH_FALSE);
+   }
+
+   return (AH_TRUE);
+}
+
+/*
  * Power management functions
  */
 
@@ -2445,10 +2484,8 @@
break;
 
case HAL_PM_FULL_SLEEP:
-   if (set_chip == AH_TRUE) {
-   AR5K_REG_WRITE(AR5K_AR5212_SCR,
-   AR5K_AR5212_SCR_SLE_SLP);
-   }
+   if (set_chip == AH_TRUE)
+   ar5k_ar5212_warm_reset(hal);
staid |= AR5K_AR5212_STA_ID1_PWR_SV;
break;
 


-- 
Dinar Talypov t.dina...@gmail.com



Re: PATCH: Virtio memory balooning

2012-11-12 Thread Dinar Talypov
Hi,
I'm not good at writing manuals,
but here is man page bits for viomb(4):

Index: Makefile
===
RCS file: /cvs/src/share/man/man4/Makefile,v
retrieving revision 1.540
diff -u -r1.540 Makefile
--- src/share/man/man4/Makefile 20 Sep 2012 15:11:44 -  1.540
+++ src/share/man/man4/Makefile 12 Nov 2012 06:38:51 -
@@ -66,7 +66,7 @@
uthum.4 uticom.4 utwitch.4 utrh.4 uts.4 uvideo.4 uvisor.4 uvscom.4 \
uyap.4 \
vether.4 vga.4 vgafb.4 vge.4 \
-   viapm.4 viasio.4 vic.4 video.4 vio.4 vioblk.4 virtio.4 vlan.4 \
+   viapm.4 viasio.4 vic.4 video.4 vio.4 vioblk.4 viomb.4 virtio.4 vlan.4 \
vmt.4 vnd.4 vr.4 \
vscsi.4 vte.4 \
watchdog.4 wb.4 wbenv.4 wbng.4 wbsd.4 wbsio.4 wd.4 wdc.4 we.4 \
--- /dev/null   Mon Nov 12 10:39:15 2012
+++ src/share/man/man4/viomb.4  Mon Nov 12 10:37:07 2012
@@ -0,0 +1,75 @@
+.\$NetBSD: viomb.4,v 1.2 2011/11/26 22:36:14 wiz Exp $
+.\$OpenBSD$
+.\ Copyright (c) 2012 Dinar Talypov di...@i-nk.ru
+.\ Copyright (C) 2011 Minoura Makoto.
+.\ All rights reserved.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+.\ AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+.\ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.Dd $Mdocdate$
+.Dt VIOMB 4
+.Os
+.Sh NAME
+.Nm viomb
+.Nd VirtIO memory ballooning driver
+.Sh SYNOPSIS
+.Cd virtio* at pci? dev ? function ?
+.Cd viomb*  at virtio?
+.Sh DESCRIPTION
+The
+.Nm
+driver supports the virtio-compliant memory ballooning device.
+.Pp
+Memory ballooning works as follows:
+.Pp
+.Bl -enum -compact
+.It
+The host operator requests a guest to return some amount of memory to the host
+(via e.g. Qemu monitor balloon command).
+.It
+The hypervisor sends the request via VirtIO memory ballooning device.
+.It
+The guest
+.Nm
+driver requests allocation of that amount of physical memory from the
+.Ox
+memory management system.
+.It
+The
+.Nm
+device tells the hypervisor the guest physical memory address of the
+allocated memory via VirtIO memory ballooning device.
+.El
+.Pp
+.Sh SEE ALSO
+.Xr virtio 4
+.Pp
+.Rs
+.%A Rusty Russell, IBM Corporation
+.%T Virtio PCI Card Specification
+.%U http://ozlabs.org/~rusty/virtio-spec/
+.Re
+.Sh HISTORY
+The
+.Nm
+device driver appeared in
+.Ox 5.3 .



Re: PATCH: Virtio memory balooning

2012-11-07 Thread Dinar Talypov
Hi,

Here is a updated version:
- fixes panic when host requests more memory to deflate than guest has
- some cleanup

Index: files.pci
===
RCS file: /cvs/src/sys/dev/pci/files.pci,v
retrieving revision 1.289
diff -u -r1.289 files.pci
--- files.pci   29 Oct 2012 18:36:42 -  1.289
+++ files.pci   6 Nov 2012 10:34:22 -
@@ -837,3 +837,7 @@
 device vioblk: scsi
 attach vioblk at virtio
 file   dev/pci/vioblk.cvioblk
+
+device viomb
+attach viomb at virtio
+file   dev/pci/viomb.c viomb
Index: GENERIC
===
RCS file: /cvs/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.741
diff -u -r1.741 GENERIC
--- GENERIC 8 Oct 2012 17:26:02 -   1.741
+++ GENERIC 6 Nov 2012 10:36:25 -
@@ -799,3 +799,4 @@
 virtio*at pci? # Virtio PCI device
 vioblk*at virtio?  # Virtio block device
 vio*   at virtio?  # Virtio network device
+viomb* at virtio?  # Virtio memory ballooning device
--- /dev/null   Thu Nov  8 11:03:03 2012
+++ sys/dev/pci/viomb.c Thu Nov  8 11:02:31 2012
@@ -0,0 +1,447 @@
+/* $OpenBSD$*/
+/* $NetBSD: viomb.c,v 1.1 2011/10/30 12:12:21 hannken Exp $ */
+/*
+ * Copyright (c) 2012 Dinar Talypov di...@i-nk.ru
+ * Copyright (c) 2010 Minoura Makoto.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/malloc.h
+#include sys/device.h
+#include sys/workq.h
+#include sys/stdint.h
+#include uvm/uvm.h
+#include dev/pci/pcidevs.h
+#include dev/pci/pcivar.h
+
+#include dev/pci/virtioreg.h
+#include dev/pci/virtiovar.h
+
+#defineDEVNAME(sc) sc-sc_dev.dv_xname
+
+#if VIRTIO_DEBUG
+#define VIOMBDEBUG(sc, format, args...)\
+   do { printf(%s:  format, sc-sc_dev.dv_xname, ##args);} \
+   while (0)
+#else
+#define VIOMBDEBUG(...)
+#endif
+
+/* flags used to specify kind of operation,
+ * actually should be moved to virtiovar.h
+ */
+#define VRING_READ 0
+#define VRING_WRITE1
+
+/* notify or don't notify */
+#define VRING_NO_NOTIFY0
+#define VRING_NOTIFY   1
+
+/* Configuration registers */
+#define VIRTIO_BALLOON_CONFIG_NUM_PAGES0   /* 32bit */
+#define VIRTIO_BALLOON_CONFIG_ACTUAL   4   /* 32bit */
+
+/* Feature bits */
+#define VIRTIO_BALLOON_F_MUST_TELL_HOST (10)
+#define VIRTIO_BALLOON_F_STATS_VQ  (11)
+
+static const struct virtio_feature_name viomb_feature_names[] = {
+   {VIRTIO_BALLOON_F_MUST_TELL_HOST, TellHost},
+   {VIRTIO_BALLOON_F_STATS_VQ, StatVQ},
+   {0, NULL}
+};
+#define PGS_PER_REQ256 /* 1MB, 4KB/page */
+#define VQ_INFLATE 0
+#define VQ_DEFLATE 1
+
+struct balloon_req {
+   bus_dmamap_tbl_dmamap;
+   struct pglist   bl_pglist;
+   int bl_nentries;
+   uint32_tbl_pages[PGS_PER_REQ];
+};
+
+struct viomb_softc {
+   struct device   sc_dev;
+   struct virtio_softc *sc_virtio;
+
+   struct virtqueuesc_vq[2];
+   u_int32_t   sc_npages;
+   u_int32_t   sc_actual;
+   u_int32_t   sc_balloon_size;
+   int sc_inflight;
+   struct balloon_req  sc_req;
+   struct pglist   sc_balloon_pages;
+   int sc_flags;
+#define INFALTE_DONE   0x01
+#define DEFLATE_DONE   0x02
+};
+
+int viomb_match(struct device *, void *, void *);
+voidviomb_attach(struct device *, struct device *, void *);
+int viomb_intr(void *);
+void

a small if_vio error handling patch

2012-11-05 Thread Dinar Talypov
Hi,
Here is a small rewrite for consistency in vio_attach() error handling path,
also a fix for dmesg message vlan2: initialized with non-standard mtu
1496 (parent vio0),
while creating vlan

Index: if_vio.c
===
RCS file: /cvs/src/sys/dev/pci/if_vio.c,v
retrieving revision 1.3
diff -u -r1.3 if_vio.c
--- sys/dev/pci/if_vio.c31 Oct 2012 00:07:21 -  1.3
+++ sys/dev/pci/if_vio.c6 Nov 2012 05:50:16 -
@@ -485,6 +485,7 @@
struct vio_softc *sc = (struct vio_softc *)self;
struct virtio_softc *vsc = (struct virtio_softc *)parent;
uint32_t features;
+   int i;
struct ifnet *ifp = sc-sc_ac.ac_if;

if (vsc-sc_child != NULL) {
@@ -559,7 +560,7 @@
ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp-if_start = vio_start;
ifp-if_ioctl = vio_ioctl;
-   ifp-if_capabilities = 0;
+   ifp-if_capabilities = IFCAP_VLAN_MTU;
IFQ_SET_MAXLEN(ifp-if_snd, vsc-sc_vqs[1].vq_num - 1);
IFQ_SET_READY(ifp-if_snd);
ifmedia_init(sc-sc_media, 0, vio_media_change, vio_media_status);
@@ -575,18 +576,9 @@
return;

 err:
-   if (vsc-sc_nvqs == 3) {
-   virtio_free_vq(vsc, sc-sc_vq[2]);
-   vsc-sc_nvqs = 2;
-   }
-   if (vsc-sc_nvqs == 2) {
-   virtio_free_vq(vsc, sc-sc_vq[1]);
-   vsc-sc_nvqs = 1;
-   }
-   if (vsc-sc_nvqs == 1) {
-   virtio_free_vq(vsc, sc-sc_vq[0]);
-   vsc-sc_nvqs = 0;
-   }
+   for (i = 0; i  vsc-sc_nvqs; i++)
+   virtio_free_vq(vsc, sc-sc_vq[i]);
+   vsc-sc_nvqs = 0;
vsc-sc_child = VIRTIO_CHILD_ERROR;
return;
 }



YP=no in mk.conf and ypldap

2011-02-09 Thread Dinar Talypov
Hi,

While building system with YP=no set in mk.conf
I have found a bug: ypldap depends on yp in libc.

The fix below. 

-- 
Dinar Talypov di...@yantel.ru


Index: Makefile
===
RCS file: /cvs/src/usr.sbin/Makefile,v
retrieving revision 1.153
diff -u -r1.153 Makefile
--- Makefile24 Sep 2010 13:05:00 -  1.153
+++ Makefile9 Feb 2011 07:46:38 -
@@ -16,14 +16,14 @@
sa sasyncd sensorsd sliplogin slstats smtpd snmpctl snmpd spamdb \
spray syslogc syslogd sysmerge tcpdrop tcpdump timed tokenadm \
tokeninit traceroute traceroute6 trpt usbdevs user vipw watchdogd \
-   wsconscfg wsfontload wsmoused ypldap zdump zic ztsscale
+   wsconscfg wsfontload wsmoused zdump zic ztsscale

 .if (${AFS:L} == yes)
 SUBDIR+=afs
 .endif

 .if (${YP:L} == yes)
-SUBDIR+=ypbind yppoll ypset ypserv
+SUBDIR+=ypldap ypbind yppoll ypset ypserv
 .endif

 .include bsd.subdir.mk