Patchwork Enhance network stack detection on IBM pSeries

login
register
mail settings
Submitter Ricardo M. Matinata
Date Aug. 20, 2012, 8:08 p.m.
Message ID <1345493290-399-1-git-send-email-matinata@br.ibm.com>
Download mbox | patch
Permalink /patch/178926/
State New
Headers show

Comments

Ricardo M. Matinata - Aug. 20, 2012, 8:08 p.m.
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 <matinata@br.ibm.com>
---
 second/fs_of.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

Patch

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) {