From patchwork Mon Aug 20 20:08:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo M. Matinata" X-Patchwork-Id: 178926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id A9ABE2C00C4 for ; Tue, 21 Aug 2012 06:08:26 +1000 (EST) Received: from e24smtp04.br.ibm.com (e24smtp04.br.ibm.com [32.104.18.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e24smtp04.br.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 933FA2C0091 for ; Tue, 21 Aug 2012 06:08:23 +1000 (EST) Received: from /spool/local by e24smtp04.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Aug 2012 17:08:15 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp04.br.ibm.com (10.172.0.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Aug 2012 17:08:13 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 809FD3520050 for ; Mon, 20 Aug 2012 16:08:08 -0400 (EDT) Received: from d24av03.br.ibm.com (d24av03.br.ibm.com [9.8.31.95]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7KK438U3133474 for ; Mon, 20 Aug 2012 17:04:03 -0300 Received: from d24av03.br.ibm.com (loopback [127.0.0.1]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7KI8VG1000375 for ; Mon, 20 Aug 2012 15:08:31 -0300 Received: from oc1727203485.ibm.com ([9.78.145.15]) by d24av03.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7KI8V1g000358 for ; Mon, 20 Aug 2012 15:08:31 -0300 From: "Ricardo M. Matinata" To: yaboot-devel@lists.ozlabs.org Subject: [PATCH] Enhance network stack detection on IBM pSeries Date: Mon, 20 Aug 2012 17:08:10 -0300 Message-Id: <1345493290-399-1-git-send-email-matinata@br.ibm.com> X-Mailer: git-send-email 1.7.1 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12082020-8936-0000-0000-000007C09758 X-BeenThere: yaboot-devel@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: yaboot-devel-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Yaboot-devel" Instead of testing for /packages/cas existence, as a criteria for using new-styled tftp in OFW, replace it by /ibm,fw-net-compatibility, which seems to be more appropriate (broader), for now. Signed-off-by: Ricardo M. Matinata --- second/fs_of.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/second/fs_of.c b/second/fs_of.c index 77113b1..f9aaf28 100644 --- a/second/fs_of.c +++ b/second/fs_of.c @@ -140,6 +140,8 @@ of_net_open(struct boot_file_t* file, char *filename = NULL; char *p; int new_tftp; + prom_handle root; + ihandle prom_net; DEBUG_ENTER; DEBUG_OPEN; @@ -161,11 +163,14 @@ of_net_open(struct boot_file_t* file, if (fspec->dev[strlen(fspec->dev)-1] != ':') strcat(buffer, ":"); - /* If /packages/cas exists the we have a "new skool" tftp. + /* If /ibm,fw-net-compatibility exists the we have a "new skool" tftp. * This means that siaddr is the tftp server and that we can add * {tftp,bootp}_retrys, subnet mask and tftp block size to the load * method */ - new_tftp = (prom_finddevice("/packages/cas") != PROM_INVALID_HANDLE); + new_tftp = 0; + root = prom_finddevice("/"); + if (prom_getprop(root, "ibm,fw-net-compatibility", &prom_net, sizeof(ihandle)) > 0) + new_tftp = 1; DEBUG_F("Using %s tftp style\n", (new_tftp? "new": "old")); if (new_tftp) {