From owner-freebsd-wireless@FreeBSD.ORG Wed Jan 25 03:22:20 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A253C106566B for ; Wed, 25 Jan 2012 03:22:20 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1EF148FC08 for ; Wed, 25 Jan 2012 03:22:19 +0000 (UTC) Received: by yenq3 with SMTP id q3so2330638yen.13 for ; Tue, 24 Jan 2012 19:22:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:from:to:content-type:mime-version:subject:date :x-mailer; bh=kgG4d0j8jBpFpQ/AldmnIX3hYpmUWCnf4jFiLBHnbMc=; b=ljrfNv+WGPWeqRMcxJMXrKUIsEFVhAQFiJohKmGmW1fyhuQZ40JfbcJuVV0LO9mrOw miiHE/Vn6QcNGnLYdyujJeLa1YcLB2JeEypwESC29r/0eldcq5fRBWkHeEdW9lEsweqF FjMn4CG3XuKJXqnXIPJIUR9XJ3nCk7i5kuZ/c= Received: by 10.236.155.234 with SMTP id j70mr21690681yhk.123.1327460433299; Tue, 24 Jan 2012 19:00:33 -0800 (PST) Received: from triad.knownspace (216-15-41-8.c3-0.gth-ubr1.lnh-gth.md.cable.rcn.com. [216.15.41.8]) by mx.google.com with ESMTPS id j16sm50561677anm.9.2012.01.24.19.00.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 19:00:32 -0800 (PST) Sender: Justin Hibbits Message-Id: <81F29D74-1AA1-4DA8-81A1-951DDFB22F2B@freebsd.org> From: Justin Hibbits To: freebsd-wireless@freebsd.org Content-Type: multipart/mixed; boundary=Apple-Mail-2--886735953 Mime-Version: 1.0 (Apple Message framework v936) Date: Tue, 24 Jan 2012 21:58:18 -0500 X-Mailer: Apple Mail (2.936) Subject: if_wi patch X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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: Wed, 25 Jan 2012 03:22:20 -0000 --Apple-Mail-2--886735953 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Can someone test this patch on x86? The patch is needed to work properly on big-endian architectures (tested on ppc with my if_wi macio attachment, to be committed after wider testing). Taken from the OpenBSD driver. - Justin --Apple-Mail-2--886735953 Content-Disposition: attachment; filename=wi.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="wi.diff" Content-Transfer-Encoding: 7bit Index: sys/dev/wi/if_wi.c =================================================================== --- sys/dev/wi/if_wi.c (revision 230483) +++ sys/dev/wi/if_wi.c (working copy) @@ -1898,8 +1898,7 @@ 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; @@ -1908,9 +1907,7 @@ 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; } @@ -1918,8 +1915,7 @@ 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; @@ -1929,9 +1925,7 @@ 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; --Apple-Mail-2--886735953 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit --Apple-Mail-2--886735953--