From owner-svn-src-all@FreeBSD.ORG Mon Jul 29 05:39:21 2013 Return-Path: Delivered-To: svn-src-all@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 ESMTP id 10000F06; Mon, 29 Jul 2013 05:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) 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 F1AE92C23; Mon, 29 Jul 2013 05:39:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6T5dKOd054387; Mon, 29 Jul 2013 05:39:20 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6T5dKsE054386; Mon, 29 Jul 2013 05:39:20 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201307290539.r6T5dKsE054386@svn.freebsd.org> From: Justin Hibbits Date: Mon, 29 Jul 2013 05:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r253756 - head/sys/dev/wi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 05:39:21 -0000 Author: jhibbits Date: Mon Jul 29 05:39:20 2013 New Revision: 253756 URL: http://svnweb.freebsd.org/changeset/base/253756 Log: Use the streaming functions for reading/writing the BAP fields on wi(4). This fixes wi(4) device access on big endian architectures. PR: kern/164499 Reviewed by: adrian Obtained from: NetBSD Modified: head/sys/dev/wi/if_wi.c Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Sun Jul 28 20:11:31 2013 (r253755) +++ head/sys/dev/wi/if_wi.c Mon Jul 29 05:39:20 2013 (r253756) @@ -1905,8 +1905,7 @@ wi_seek_bap(struct wi_softc *sc, int id, static int wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1915,9 +1914,7 @@ wi_read_bap(struct wi_softc *sc, int id, return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - *ptr++ = CSR_READ_2(sc, WI_DATA0); + CSR_READ_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0; } @@ -1925,8 +1922,7 @@ wi_read_bap(struct wi_softc *sc, int id, static int wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1936,9 +1932,7 @@ wi_write_bap(struct wi_softc *sc, int id return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - CSR_WRITE_2(sc, WI_DATA0, ptr[i]); + CSR_WRITE_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0;