From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 05:40:01 2013 Return-Path: Delivered-To: freebsd-wireless@smarthost.ysv.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 C5E04D0 for ; Mon, 29 Jul 2013 05:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 999C52C2D for ; Mon, 29 Jul 2013 05:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6T5e1ev083074 for ; Mon, 29 Jul 2013 05:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6T5e1Va083073; Mon, 29 Jul 2013 05:40:01 GMT (envelope-from gnats) Date: Mon, 29 Jul 2013 05:40:01 GMT Message-Id: <201307290540.r6T5e1Va083073@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: kern/164499: commit references a PR X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 05:40:01 -0000 The following reply was made to PR kern/164499; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/164499: commit references a PR Date: Mon, 29 Jul 2013 05:39:28 +0000 (UTC) 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; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"