From owner-freebsd-sparc64@FreeBSD.ORG Mon Nov 8 08:44:40 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E2AAB16A4CE for ; Mon, 8 Nov 2004 08:44:40 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F0FD43D49 for ; Mon, 8 Nov 2004 08:44:40 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id iA88hUAh027323 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Mon, 8 Nov 2004 17:43:30 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) iA88iZM1001780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 8 Nov 2004 17:44:35 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.12.10/8.12.10/Submit) id iA88iZ2T001779 for freebsd-sparc64@freebsd.org; Mon, 8 Nov 2004 17:44:35 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Mon, 8 Nov 2004 17:44:35 +0900 From: Pyun YongHyeon To: freebsd-sparc64@freebsd.org Message-ID: <20041108084435.GA1511@kt-is.co.kr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) Subject: Executing downloaded micorcode of fxp panics sparc64 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2004 08:44:41 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, It seems that fxp driver panics sparc64 system when executing downloaded microcode. The following patch fixes the panic. It would be appriciated if interested users could apply the patch, download microcode and try to pass packets on fxp. Thanks. -- Regards, Pyun YongHyeon http://www.kr.freebsd.org/~yongari | yongari@freebsd.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fxp.patch" --- if_fxp.c.orig Mon Sep 20 11:22:43 2004 +++ if_fxp.c Mon Nov 8 17:35:53 2004 @@ -2624,7 +2624,7 @@ static u_int32_t fxp_ucode_d102[] = D102_B_RCVBUNDLE_UCODE; static u_int32_t fxp_ucode_d102c[] = D102_C_RCVBUNDLE_UCODE; -#define UCODE(x) x, sizeof(x) +#define UCODE(x) x, sizeof(x)/sizeof(u_int32_t) struct ucode { u_int32_t revision; @@ -2651,6 +2651,7 @@ { struct ucode *uc; struct fxp_cb_ucode *cbp; + int i; for (uc = ucode_table; uc->ucode != NULL; uc++) if (sc->revision == uc->revision) @@ -2661,7 +2662,8 @@ cbp->cb_status = 0; cbp->cb_command = htole16(FXP_CB_COMMAND_UCODE | FXP_CB_COMMAND_EL); cbp->link_addr = 0xffffffff; /* (no) next command */ - memcpy(cbp->ucode, uc->ucode, uc->length); + for (i = 0; i < uc->length; i++) + cbp->ucode[i] = htole32(uc->ucode[i]); if (uc->int_delay_offset) *(u_int16_t *)&cbp->ucode[uc->int_delay_offset] = htole16(sc->tunable_int_delay + sc->tunable_int_delay / 2); --LZvS9be/3tNcYl/X--