Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e996b32e0585756c335b35980dc68852c33f297
Commit:     4e996b32e0585756c335b35980dc68852c33f297
Parent:     e919b5938b11e1d48a6dcdcb2860e890a954f10d
Author:     Thomas Klein <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 22 12:53:50 2007 +0100
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Jan 23 00:59:20 2007 -0500

    ehea: New method to determine number of available ports
    
    Count OFDT nodes to determine the number of available ports
    instead of using the possibly outdated value from the hypervisor
    
    Signed-off-by: Thomas Klein <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/ehea/ehea_main.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d84d095..9486e0a 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2269,6 +2269,8 @@ static void ehea_tx_watchdog(struct net_device *dev)
 int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
 {
        struct hcp_query_ehea *cb;
+       struct device_node *lhea_dn = NULL;
+       struct device_node *eth_dn = NULL;
        u64 hret;
        int ret;
 
@@ -2285,7 +2287,18 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
                goto out_herr;
        }
 
-       adapter->num_ports = cb->num_ports;
+       /* Determine the number of available logical ports
+        * by counting the child nodes of the lhea OFDT entry
+        */
+       adapter->num_ports = 0;
+       lhea_dn = of_find_node_by_name(lhea_dn, "lhea");
+       do {
+               eth_dn = of_get_next_child(lhea_dn, eth_dn);
+               if (eth_dn)
+                       adapter->num_ports++;
+       } while ( eth_dn );
+       of_node_put(lhea_dn);
+
        adapter->max_mc_mac = cb->max_mc_mac - 1;
        ret = 0;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to