From owner-svn-src-head@FreeBSD.ORG Sat Jan 25 07:13:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3664CC4B; Sat, 25 Jan 2014 07:13:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2302116E0; Sat, 25 Jan 2014 07:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0P7Dm7v073154; Sat, 25 Jan 2014 07:13:48 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0P7DlAo073153; Sat, 25 Jan 2014 07:13:47 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201401250713.s0P7DlAo073153@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 25 Jan 2014 07:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261150 - head/sys/dev/virtio/network X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jan 2014 07:13:48 -0000 Author: bryanv Date: Sat Jan 25 07:13:47 2014 New Revision: 261150 URL: http://svnweb.freebsd.org/changeset/base/261150 Log: Read and write the MAC address in the config space byte by byte Modified: head/sys/dev/virtio/network/if_vtnet.c Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Sat Jan 25 07:01:51 2014 (r261149) +++ head/sys/dev/virtio/network/if_vtnet.c Sat Jan 25 07:13:47 2014 (r261150) @@ -3485,6 +3485,7 @@ static void vtnet_set_hwaddr(struct vtnet_softc *sc) { device_t dev; + int i; dev = sc->vtnet_dev; @@ -3492,9 +3493,11 @@ vtnet_set_hwaddr(struct vtnet_softc *sc) if (vtnet_ctrl_mac_cmd(sc, sc->vtnet_hwaddr) != 0) device_printf(dev, "unable to set MAC address\n"); } else if (sc->vtnet_flags & VTNET_FLAG_MAC) { - virtio_write_device_config(dev, - offsetof(struct virtio_net_config, mac), - sc->vtnet_hwaddr, ETHER_ADDR_LEN); + for (i = 0; i < ETHER_ADDR_LEN; i++) { + virtio_write_dev_config_1(dev, + offsetof(struct virtio_net_config, mac) + i, + sc->vtnet_hwaddr[i]); + } } } @@ -3502,6 +3505,7 @@ static void vtnet_get_hwaddr(struct vtnet_softc *sc) { device_t dev; + int i; dev = sc->vtnet_dev; @@ -3519,8 +3523,10 @@ vtnet_get_hwaddr(struct vtnet_softc *sc) return; } - virtio_read_device_config(dev, offsetof(struct virtio_net_config, mac), - sc->vtnet_hwaddr, ETHER_ADDR_LEN); + for (i = 0; i < ETHER_ADDR_LEN; i++) { + sc->vtnet_hwaddr[i] = virtio_read_dev_config_1(dev, + offsetof(struct virtio_net_config, mac) + i); + } } static void